Update can_set_ctrlmode() documentation
Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>pull/106/head^2
parent
5938ac70cb
commit
4ea9ec7cf3
|
|
@ -774,13 +774,20 @@ int can_set_restart_ms(const char *name, __u32 restart_ms)
|
||||||
*
|
*
|
||||||
* @param cm pointer of a can_ctrlmode struct
|
* @param cm pointer of a can_ctrlmode struct
|
||||||
*
|
*
|
||||||
* This sets the control mode of the can device. There're currently three
|
* This sets the control mode of the can device. There are currently the
|
||||||
* different control modes:
|
* following modes available (each mapped to its own macro):
|
||||||
* - LOOPBACK
|
|
||||||
* - LISTEN_ONLY
|
|
||||||
* - TRIPPLE_SAMPLING
|
|
||||||
*
|
*
|
||||||
* You have to define the control mode struct yourself. a can_ctrlmode struct
|
* @code
|
||||||
|
* #define CAN_CTRLMODE_LOOPBACK 0x01 // Loopback mode
|
||||||
|
* #define CAN_CTRLMODE_LISTENONLY 0x02 // Listen-only mode
|
||||||
|
* #define CAN_CTRLMODE_3_SAMPLES 0x04 // Triple sampling mode
|
||||||
|
* #define CAN_CTRLMODE_ONE_SHOT 0x08 // One-Shot mode
|
||||||
|
* #define CAN_CTRLMODE_BERR_REPORTING 0x10 // Bus-error reporting
|
||||||
|
* #define CAN_CTRLMODE_FD 0x20 // CAN FD mode
|
||||||
|
* #define CAN_CTRLMODE_PRESUME_ACK 0x40 // Ignore missing CAN ACKs
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* You have to define the control mode struct yourself. A can_ctrlmode struct
|
||||||
* is declared as:
|
* is declared as:
|
||||||
*
|
*
|
||||||
* @code
|
* @code
|
||||||
|
|
@ -791,16 +798,8 @@ int can_set_restart_ms(const char *name, __u32 restart_ms)
|
||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* You can use mask to select modes you want to control and flags to determine
|
* You can use mask to select modes you want to control and flags to determine
|
||||||
* if you want to turn the selected mode(s) on or off. Every control mode is
|
* if you want to turn the selected mode(s) on or off. E. g. the following
|
||||||
* mapped to an own macro
|
* pseudocode will turn the loopback mode on and listenonly mode off:
|
||||||
*
|
|
||||||
* @code
|
|
||||||
* #define CAN_CTRLMODE_LOOPBACK 0x1
|
|
||||||
* #define CAN_CTRLMODE_LISTENONLY 0x2
|
|
||||||
* #define CAN_CTRLMODE_3_SAMPLES 0x4
|
|
||||||
* @endcode
|
|
||||||
*
|
|
||||||
* e.g. the following pseudocode
|
|
||||||
*
|
*
|
||||||
* @code
|
* @code
|
||||||
* struct can_ctrlmode cm;
|
* struct can_ctrlmode cm;
|
||||||
|
|
@ -810,8 +809,6 @@ int can_set_restart_ms(const char *name, __u32 restart_ms)
|
||||||
* can_set_ctrlmode(candev, &cm);
|
* can_set_ctrlmode(candev, &cm);
|
||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* will turn the loopback mode on and listenonly mode off.
|
|
||||||
*
|
|
||||||
* @return 0 if success
|
* @return 0 if success
|
||||||
* @return -1 if failed
|
* @return -1 if failed
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue