diff options
author | Luis Carlos Cobo <luisca@cozybit.com> | 2007-05-25 13:53:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:41 -0400 |
commit | 90e8eafc93ed159846bb7126af8502f2a8570a11 (patch) | |
tree | a949978a5a7d199953f9876672e202dffeba40b8 /drivers/net/wireless/libertas | |
parent | 7db283c914457dbeb72878df0641f4a5e05d75fa (diff) |
[PATCH] libertas: updated mesh commands for 5.220.9.p11
Updated commands fwt_add and fwt_list, bt_list.
New commands: bt_get_invert, bt_set_invert, to invert the blinding table,
i.e., receive only frames from nodes listed in the BT.
This patch needs/is needed for firmware 5.220.9.p11.
Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/defs.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/host.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/hostcmd.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/ioctl.c | 78 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.h | 12 |
7 files changed, 106 insertions, 8 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 5aaeb91418b4..910706c54def 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -861,6 +861,11 @@ static int wlan_cmd_bt_access(wlan_private * priv, | |||
861 | break; | 861 | break; |
862 | case cmd_act_bt_access_reset: | 862 | case cmd_act_bt_access_reset: |
863 | break; | 863 | break; |
864 | case cmd_act_bt_access_set_invert: | ||
865 | bt_access->id = cpu_to_le32(*(u32 *) pdata_buf); | ||
866 | break; | ||
867 | case cmd_act_bt_access_get_invert: | ||
868 | break; | ||
864 | default: | 869 | default: |
865 | break; | 870 | break; |
866 | } | 871 | } |
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h index b189d3bce2e8..e78421fce4eb 100644 --- a/drivers/net/wireless/libertas/defs.h +++ b/drivers/net/wireless/libertas/defs.h | |||
@@ -374,6 +374,8 @@ enum SNMP_MIB_VALUE_e { | |||
374 | /* Default values for fwt commands. */ | 374 | /* Default values for fwt commands. */ |
375 | #define FWT_DEFAULT_METRIC 0 | 375 | #define FWT_DEFAULT_METRIC 0 |
376 | #define FWT_DEFAULT_DIR 1 | 376 | #define FWT_DEFAULT_DIR 1 |
377 | /* Default Rate, 11Mbps */ | ||
378 | #define FWT_DEFAULT_RATE 3 | ||
377 | #define FWT_DEFAULT_SSN 0xffffffff | 379 | #define FWT_DEFAULT_SSN 0xffffffff |
378 | #define FWT_DEFAULT_DSN 0 | 380 | #define FWT_DEFAULT_DSN 0 |
379 | #define FWT_DEFAULT_HOPCOUNT 0 | 381 | #define FWT_DEFAULT_HOPCOUNT 0 |
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h index b7acdc2b1aee..e12dbc65accc 100644 --- a/drivers/net/wireless/libertas/host.h +++ b/drivers/net/wireless/libertas/host.h | |||
@@ -287,7 +287,9 @@ enum cmd_bt_access_opts { | |||
287 | cmd_act_bt_access_add = 5, | 287 | cmd_act_bt_access_add = 5, |
288 | cmd_act_bt_access_del, | 288 | cmd_act_bt_access_del, |
289 | cmd_act_bt_access_list, | 289 | cmd_act_bt_access_list, |
290 | cmd_act_bt_access_reset | 290 | cmd_act_bt_access_reset, |
291 | cmd_act_bt_access_set_invert, | ||
292 | cmd_act_bt_access_get_invert | ||
291 | }; | 293 | }; |
292 | 294 | ||
293 | /* Define action or option for cmd_fwt_access */ | 295 | /* Define action or option for cmd_fwt_access */ |
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h index e7745fc2865e..581b9a37d7b7 100644 --- a/drivers/net/wireless/libertas/hostcmd.h +++ b/drivers/net/wireless/libertas/hostcmd.h | |||
@@ -607,18 +607,21 @@ struct cmd_ds_bt_access { | |||
607 | struct cmd_ds_fwt_access { | 607 | struct cmd_ds_fwt_access { |
608 | u16 action; | 608 | u16 action; |
609 | u32 id; | 609 | u32 id; |
610 | u8 valid; | ||
610 | u8 da[ETH_ALEN]; | 611 | u8 da[ETH_ALEN]; |
611 | u8 dir; | 612 | u8 dir; |
612 | u8 ra[ETH_ALEN]; | 613 | u8 ra[ETH_ALEN]; |
613 | u32 ssn; | 614 | u32 ssn; |
614 | u32 dsn; | 615 | u32 dsn; |
615 | u32 metric; | 616 | u32 metric; |
617 | u8 rate; | ||
616 | u8 hopcount; | 618 | u8 hopcount; |
617 | u8 ttl; | 619 | u8 ttl; |
618 | u32 expiration; | 620 | u32 expiration; |
619 | u8 sleepmode; | 621 | u8 sleepmode; |
620 | u32 snr; | 622 | u32 snr; |
621 | u32 references; | 623 | u32 references; |
624 | u8 prec[ETH_ALEN]; | ||
622 | } __attribute__ ((packed)); | 625 | } __attribute__ ((packed)); |
623 | 626 | ||
624 | struct cmd_ds_mesh_access { | 627 | struct cmd_ds_mesh_access { |
diff --git a/drivers/net/wireless/libertas/ioctl.c b/drivers/net/wireless/libertas/ioctl.c index 3f95e97a309e..5a5863239067 100644 --- a/drivers/net/wireless/libertas/ioctl.c +++ b/drivers/net/wireless/libertas/ioctl.c | |||
@@ -241,7 +241,7 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) | |||
241 | if (ret == 0) { | 241 | if (ret == 0) { |
242 | addr1 = param.addr1addr2; | 242 | addr1 = param.addr1addr2; |
243 | 243 | ||
244 | pos = sprintf(pbuf, "ignoring traffic from "); | 244 | pos = sprintf(pbuf, "BT includes node "); |
245 | pbuf += pos; | 245 | pbuf += pos; |
246 | pos = eth_addr2str(addr1, pbuf); | 246 | pos = eth_addr2str(addr1, pbuf); |
247 | pbuf += pos; | 247 | pbuf += pos; |
@@ -258,6 +258,64 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) | |||
258 | } | 258 | } |
259 | 259 | ||
260 | lbs_deb_leave(LBS_DEB_IOCTL); | 260 | lbs_deb_leave(LBS_DEB_IOCTL); |
261 | return 0 ; | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * @brief Sets inverted state of blacklist (non-zero if inverted) | ||
266 | * @param priv A pointer to wlan_private structure | ||
267 | * @param req A pointer to ifreq structure | ||
268 | * @return 0 --success, otherwise fail | ||
269 | */ | ||
270 | static int wlan_bt_set_invert_ioctl(wlan_private * priv, struct ifreq *req) | ||
271 | { | ||
272 | int ret; | ||
273 | struct iwreq *wrq = (struct iwreq *)req; | ||
274 | union { | ||
275 | int id; | ||
276 | char addr1addr2[2 * ETH_ALEN]; | ||
277 | } param; | ||
278 | |||
279 | lbs_deb_enter(LBS_DEB_IOCTL); | ||
280 | |||
281 | param.id = SUBCMD_DATA(wrq) ; | ||
282 | ret = libertas_prepare_and_send_command(priv, cmd_bt_access, | ||
283 | cmd_act_bt_access_set_invert, | ||
284 | cmd_option_waitforrsp, 0, | ||
285 | (char *)¶m); | ||
286 | if (ret != 0) | ||
287 | return -EFAULT; | ||
288 | lbs_deb_leave(LBS_DEB_IOCTL); | ||
289 | return 0; | ||
290 | } | ||
291 | |||
292 | /** | ||
293 | * @brief Gets inverted state of blacklist (non-zero if inverted) | ||
294 | * @param priv A pointer to wlan_private structure | ||
295 | * @param req A pointer to ifreq structure | ||
296 | * @return 0 --success, otherwise fail | ||
297 | */ | ||
298 | static int wlan_bt_get_invert_ioctl(wlan_private * priv, struct ifreq *req) | ||
299 | { | ||
300 | int ret; | ||
301 | union { | ||
302 | int id; | ||
303 | char addr1addr2[2 * ETH_ALEN]; | ||
304 | } param; | ||
305 | |||
306 | lbs_deb_enter(LBS_DEB_IOCTL); | ||
307 | |||
308 | ret = libertas_prepare_and_send_command(priv, cmd_bt_access, | ||
309 | cmd_act_bt_access_get_invert, | ||
310 | cmd_option_waitforrsp, 0, | ||
311 | (char *)¶m); | ||
312 | |||
313 | if (ret == 0) | ||
314 | req->ifr_data = (char *)(le32_to_cpu(param.id)); | ||
315 | else | ||
316 | return -EFAULT; | ||
317 | |||
318 | lbs_deb_leave(LBS_DEB_IOCTL); | ||
261 | return 0; | 319 | return 0; |
262 | } | 320 | } |
263 | 321 | ||
@@ -314,6 +372,11 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) | |||
314 | fwt_access.dir = FWT_DEFAULT_DIR; | 372 | fwt_access.dir = FWT_DEFAULT_DIR; |
315 | 373 | ||
316 | if ((ptr = next_param(ptr))) | 374 | if ((ptr = next_param(ptr))) |
375 | fwt_access.rate = (u8) simple_strtoul(ptr, &ptr, 10); | ||
376 | else | ||
377 | fwt_access.rate = FWT_DEFAULT_RATE; | ||
378 | |||
379 | if ((ptr = next_param(ptr))) | ||
317 | fwt_access.ssn = | 380 | fwt_access.ssn = |
318 | cpu_to_le32(simple_strtoul(ptr, &ptr, 10)); | 381 | cpu_to_le32(simple_strtoul(ptr, &ptr, 10)); |
319 | else | 382 | else |
@@ -441,15 +504,18 @@ static void print_route(struct cmd_ds_fwt_access fwt_access, char *buf) | |||
441 | buf += eth_addr2str(fwt_access.da, buf); | 504 | buf += eth_addr2str(fwt_access.da, buf); |
442 | buf += sprintf(buf, " "); | 505 | buf += sprintf(buf, " "); |
443 | buf += eth_addr2str(fwt_access.ra, buf); | 506 | buf += eth_addr2str(fwt_access.ra, buf); |
507 | buf += sprintf(buf, " %u", fwt_access.valid); | ||
444 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.metric)); | 508 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.metric)); |
445 | buf += sprintf(buf, " %u", fwt_access.dir); | 509 | buf += sprintf(buf, " %u", fwt_access.dir); |
510 | buf += sprintf(buf, " %u", fwt_access.rate); | ||
446 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.ssn)); | 511 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.ssn)); |
447 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.dsn)); | 512 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.dsn)); |
448 | buf += sprintf(buf, " %u", fwt_access.hopcount); | 513 | buf += sprintf(buf, " %u", fwt_access.hopcount); |
449 | buf += sprintf(buf, " %u", fwt_access.ttl); | 514 | buf += sprintf(buf, " %u", fwt_access.ttl); |
450 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.expiration)); | 515 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.expiration)); |
451 | buf += sprintf(buf, " %u", fwt_access.sleepmode); | 516 | buf += sprintf(buf, " %u", fwt_access.sleepmode); |
452 | buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.snr)); | 517 | buf += sprintf(buf, " %u ", le32_to_cpu(fwt_access.snr)); |
518 | buf += eth_addr2str(fwt_access.prec, buf); | ||
453 | } | 519 | } |
454 | 520 | ||
455 | /** | 521 | /** |
@@ -866,6 +932,10 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | |||
866 | ret = wlan_mesh_set_ttl_ioctl(priv, idata); | 932 | ret = wlan_mesh_set_ttl_ioctl(priv, idata); |
867 | break; | 933 | break; |
868 | 934 | ||
935 | case WLAN_SUBCMD_BT_SET_INVERT: | ||
936 | ret = wlan_bt_set_invert_ioctl(priv, req); | ||
937 | break ; | ||
938 | |||
869 | default: | 939 | default: |
870 | ret = -EOPNOTSUPP; | 940 | ret = -EOPNOTSUPP; |
871 | break; | 941 | break; |
@@ -923,6 +993,10 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | |||
923 | ret = wlan_mesh_get_ttl_ioctl(priv, req); | 993 | ret = wlan_mesh_get_ttl_ioctl(priv, req); |
924 | break; | 994 | break; |
925 | 995 | ||
996 | case WLAN_SUBCMD_BT_GET_INVERT: | ||
997 | ret = wlan_bt_get_invert_ioctl(priv, req); | ||
998 | break ; | ||
999 | |||
926 | default: | 1000 | default: |
927 | ret = -EOPNOTSUPP; | 1001 | ret = -EOPNOTSUPP; |
928 | 1002 | ||
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 1bc2fbfe730f..4f0ae8026b0e 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -1066,6 +1066,16 @@ static const struct iw_priv_args wlan_private_args[] = { | |||
1066 | IW_PRIV_TYPE_CHAR | 128, | 1066 | IW_PRIV_TYPE_CHAR | 128, |
1067 | IW_PRIV_TYPE_CHAR | 128, | 1067 | IW_PRIV_TYPE_CHAR | 128, |
1068 | "bt_list"}, | 1068 | "bt_list"}, |
1069 | { | ||
1070 | WLAN_SUBCMD_BT_SET_INVERT, | ||
1071 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, | ||
1072 | IW_PRIV_TYPE_NONE, | ||
1073 | "bt_set_invert"}, | ||
1074 | { | ||
1075 | WLAN_SUBCMD_BT_GET_INVERT, | ||
1076 | IW_PRIV_TYPE_NONE, | ||
1077 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, | ||
1078 | "bt_get_invert"}, | ||
1069 | /* FWT Management */ | 1079 | /* FWT Management */ |
1070 | { | 1080 | { |
1071 | WLAN_SUBCMD_FWT_ADD, | 1081 | WLAN_SUBCMD_FWT_ADD, |
diff --git a/drivers/net/wireless/libertas/wext.h b/drivers/net/wireless/libertas/wext.h index 15cfaaf0797f..fb7e828dd9be 100644 --- a/drivers/net/wireless/libertas/wext.h +++ b/drivers/net/wireless/libertas/wext.h | |||
@@ -20,21 +20,23 @@ | |||
20 | #define WLAN_SUBCMD_FWT_CLEANUP 15 | 20 | #define WLAN_SUBCMD_FWT_CLEANUP 15 |
21 | #define WLAN_SUBCMD_FWT_TIME 16 | 21 | #define WLAN_SUBCMD_FWT_TIME 16 |
22 | #define WLAN_SUBCMD_MESH_GET_TTL 17 | 22 | #define WLAN_SUBCMD_MESH_GET_TTL 17 |
23 | #define WLAN_SUBCMD_BT_GET_INVERT 18 | ||
23 | 24 | ||
24 | #define WLAN_SETONEINT_GETNONE (WLANIOCTL + 24) | 25 | #define WLAN_SETONEINT_GETNONE (WLANIOCTL + 24) |
25 | #define WLANSETREGION 8 | 26 | #define WLANSETREGION 8 |
26 | #define WLAN_SUBCMD_MESH_SET_TTL 18 | 27 | #define WLAN_SUBCMD_MESH_SET_TTL 18 |
28 | #define WLAN_SUBCMD_BT_SET_INVERT 19 | ||
27 | 29 | ||
28 | #define WLAN_SET128CHAR_GET128CHAR (WLANIOCTL + 25) | 30 | #define WLAN_SET128CHAR_GET128CHAR (WLANIOCTL + 25) |
29 | #define WLAN_SUBCMD_BT_ADD 18 | 31 | #define WLAN_SUBCMD_BT_ADD 18 |
30 | #define WLAN_SUBCMD_BT_DEL 19 | 32 | #define WLAN_SUBCMD_BT_DEL 19 |
31 | #define WLAN_SUBCMD_BT_LIST 20 | 33 | #define WLAN_SUBCMD_BT_LIST 20 |
32 | #define WLAN_SUBCMD_FWT_ADD 21 | 34 | #define WLAN_SUBCMD_FWT_ADD 21 |
33 | #define WLAN_SUBCMD_FWT_DEL 22 | 35 | #define WLAN_SUBCMD_FWT_DEL 22 |
34 | #define WLAN_SUBCMD_FWT_LOOKUP 23 | 36 | #define WLAN_SUBCMD_FWT_LOOKUP 23 |
35 | #define WLAN_SUBCMD_FWT_LIST_NEIGHBOR 24 | 37 | #define WLAN_SUBCMD_FWT_LIST_NEIGHBOR 24 |
36 | #define WLAN_SUBCMD_FWT_LIST 25 | 38 | #define WLAN_SUBCMD_FWT_LIST 25 |
37 | #define WLAN_SUBCMD_FWT_LIST_ROUTE 26 | 39 | #define WLAN_SUBCMD_FWT_LIST_ROUTE 26 |
38 | 40 | ||
39 | #define WLAN_SET_GET_SIXTEEN_INT (WLANIOCTL + 29) | 41 | #define WLAN_SET_GET_SIXTEEN_INT (WLANIOCTL + 29) |
40 | #define WLAN_LED_GPIO_CTRL 5 | 42 | #define WLAN_LED_GPIO_CTRL 5 |