aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/ioctl.c
diff options
context:
space:
mode:
authorLuis Carlos Cobo <luisca@cozybit.com>2007-05-25 13:53:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:41 -0400
commit90e8eafc93ed159846bb7126af8502f2a8570a11 (patch)
treea949978a5a7d199953f9876672e202dffeba40b8 /drivers/net/wireless/libertas/ioctl.c
parent7db283c914457dbeb72878df0641f4a5e05d75fa (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/ioctl.c')
-rw-r--r--drivers/net/wireless/libertas/ioctl.c78
1 files changed, 76 insertions, 2 deletions
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 */
270static 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 *)&param);
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 */
298static 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 *)&param);
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