Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ieee1394: sbp2: change some module parameters from int to bool

This is upwards compatible, except that integer values other than 0 or 1
are no longer accepted. But values like "Y", "N", "no", "nnoooh!" work
now.

Also, improve a comment on the serialize_io parameter and make the
ORB_SET_EXCLUSIVE macro ultra-safe.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

+8 -9
+7 -8
drivers/ieee1394/sbp2.c
··· 118 118 "(3 = 800Mb/s, 2 = 400Mb/s, 1 = 200Mb/s, 0 = 100Mb/s)"); 119 119 120 120 /* 121 - * Set serialize_io to 1 if you'd like only one scsi command sent 122 - * down to us at a time (debugging). This might be necessary for very 123 - * badly behaved sbp2 devices. 121 + * Set serialize_io to 0 or N to use dynamically appended lists of command ORBs. 122 + * This is and always has been buggy in multiple subtle ways. See above TODOs. 124 123 */ 125 124 static int sbp2_serialize_io = 1; 126 - module_param_named(serialize_io, sbp2_serialize_io, int, 0444); 127 - MODULE_PARM_DESC(serialize_io, "Serialize I/O coming from scsi drivers " 128 - "(default = 1, faster = 0)"); 125 + module_param_named(serialize_io, sbp2_serialize_io, bool, 0444); 126 + MODULE_PARM_DESC(serialize_io, "Serialize requests coming from SCSI drivers " 127 + "(default = Y, faster but buggy = N)"); 129 128 130 129 /* 131 130 * Bump up max_sectors if you'd like to support very large sized ··· 153 154 * are possible on OXFW911 and newer Oxsemi bridges. 154 155 */ 155 156 static int sbp2_exclusive_login = 1; 156 - module_param_named(exclusive_login, sbp2_exclusive_login, int, 0644); 157 + module_param_named(exclusive_login, sbp2_exclusive_login, bool, 0644); 157 158 MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device " 158 - "(default = 1)"); 159 + "(default = Y, use N for concurrent initiators)"); 159 160 160 161 /* 161 162 * If any of the following workarounds is required for your device to work,
+1 -1
drivers/ieee1394/sbp2.h
··· 67 67 #define ORB_SET_LUN(v) ((v) & 0xffff) 68 68 #define ORB_SET_FUNCTION(v) (((v) & 0xf) << 16) 69 69 #define ORB_SET_RECONNECT(v) (((v) & 0xf) << 20) 70 - #define ORB_SET_EXCLUSIVE(v) (((v) & 0x1) << 28) 70 + #define ORB_SET_EXCLUSIVE(v) ((v) ? 1 << 28 : 0) 71 71 #define ORB_SET_LOGIN_RESP_LENGTH(v) ((v) & 0xffff) 72 72 #define ORB_SET_PASSWD_LENGTH(v) (((v) & 0xffff) << 16) 73 73