diff options
author | Luis Carlos Cobo Rus <luisca@cozybit.com> | 2007-05-25 23:08:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:44 -0400 |
commit | f5e05b697d2105e5c3f9d837046a8c33ee5b7e14 (patch) | |
tree | aed9aa4f8de574367c95ad420a8fd0a78ec9599f /drivers/net | |
parent | 0a0d08aca5d0a77da4b66de289acfd891a3e72e1 (diff) |
[PATCH] libertas: split wext for eth and msh
Separate wireless handlers of mshX and ethX. ethX remains as before.
For mshX, it has been disabled set/get essid, wap and set mode. Get mode always
returns "Repeater" and by now we use the Nickname to show if the mesh is active
("Mesh") or not (empty). The rest remains as before.
Signed-off-by: Luis Carlos Cobo Rus <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 104 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.h | 1 |
3 files changed, 106 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 5dde49bbda85..61cf95b73430 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -925,7 +925,7 @@ int libertas_add_mesh(wlan_private *priv, struct device *dev) | |||
925 | SET_NETDEV_DEV(priv->mesh_dev, dev); | 925 | SET_NETDEV_DEV(priv->mesh_dev, dev); |
926 | 926 | ||
927 | #ifdef WIRELESS_EXT | 927 | #ifdef WIRELESS_EXT |
928 | mesh_dev->wireless_handlers = (struct iw_handler_def *)&libertas_handler_def; | 928 | mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def; |
929 | #endif | 929 | #endif |
930 | #define NETIF_F_DYNALLOC 16 | 930 | #define NETIF_F_DYNALLOC 16 |
931 | 931 | ||
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 2edc10c3327f..e91de104ad67 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -372,6 +372,30 @@ static int wlan_get_nick(struct net_device *dev, struct iw_request_info *info, | |||
372 | return 0; | 372 | return 0; |
373 | } | 373 | } |
374 | 374 | ||
375 | static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, | ||
376 | struct iw_point *dwrq, char *extra) | ||
377 | { | ||
378 | wlan_private *priv = dev->priv; | ||
379 | wlan_adapter *adapter = priv->adapter; | ||
380 | |||
381 | lbs_deb_enter(LBS_DEB_WEXT); | ||
382 | |||
383 | /* Use nickname to indicate that mesh is on */ | ||
384 | |||
385 | if (adapter->connect_status == libertas_connected) { | ||
386 | strncpy(extra, "Mesh", 12); | ||
387 | extra[12] = '\0'; | ||
388 | dwrq->length = strlen(extra) + 1; | ||
389 | } | ||
390 | |||
391 | else { | ||
392 | extra[0] = '\0'; | ||
393 | dwrq->length = 1 ; | ||
394 | } | ||
395 | |||
396 | lbs_deb_leave(LBS_DEB_WEXT); | ||
397 | return 0; | ||
398 | } | ||
375 | static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, | 399 | static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, |
376 | struct iw_param *vwrq, char *extra) | 400 | struct iw_param *vwrq, char *extra) |
377 | { | 401 | { |
@@ -492,6 +516,18 @@ static int wlan_get_mode(struct net_device *dev, | |||
492 | return 0; | 516 | return 0; |
493 | } | 517 | } |
494 | 518 | ||
519 | static int mesh_wlan_get_mode(struct net_device *dev, | ||
520 | struct iw_request_info *info, u32 * uwrq, | ||
521 | char *extra) | ||
522 | { | ||
523 | lbs_deb_enter(LBS_DEB_WEXT); | ||
524 | |||
525 | *uwrq = IW_MODE_REPEAT ; | ||
526 | |||
527 | lbs_deb_leave(LBS_DEB_WEXT); | ||
528 | return 0; | ||
529 | } | ||
530 | |||
495 | static int wlan_get_txpow(struct net_device *dev, | 531 | static int wlan_get_txpow(struct net_device *dev, |
496 | struct iw_request_info *info, | 532 | struct iw_request_info *info, |
497 | struct iw_param *vwrq, char *extra) | 533 | struct iw_param *vwrq, char *extra) |
@@ -2342,6 +2378,63 @@ static const iw_handler wlan_handler[] = { | |||
2342 | (iw_handler) NULL, /* SIOCSIWPMKSA */ | 2378 | (iw_handler) NULL, /* SIOCSIWPMKSA */ |
2343 | }; | 2379 | }; |
2344 | 2380 | ||
2381 | static const iw_handler mesh_wlan_handler[] = { | ||
2382 | (iw_handler) NULL, /* SIOCSIWCOMMIT */ | ||
2383 | (iw_handler) wlan_get_name, /* SIOCGIWNAME */ | ||
2384 | (iw_handler) NULL, /* SIOCSIWNWID */ | ||
2385 | (iw_handler) NULL, /* SIOCGIWNWID */ | ||
2386 | (iw_handler) wlan_set_freq, /* SIOCSIWFREQ */ | ||
2387 | (iw_handler) wlan_get_freq, /* SIOCGIWFREQ */ | ||
2388 | (iw_handler) NULL, /* SIOCSIWMODE */ | ||
2389 | (iw_handler) mesh_wlan_get_mode, /* SIOCGIWMODE */ | ||
2390 | (iw_handler) NULL, /* SIOCSIWSENS */ | ||
2391 | (iw_handler) NULL, /* SIOCGIWSENS */ | ||
2392 | (iw_handler) NULL, /* SIOCSIWRANGE */ | ||
2393 | (iw_handler) wlan_get_range, /* SIOCGIWRANGE */ | ||
2394 | (iw_handler) NULL, /* SIOCSIWPRIV */ | ||
2395 | (iw_handler) NULL, /* SIOCGIWPRIV */ | ||
2396 | (iw_handler) NULL, /* SIOCSIWSTATS */ | ||
2397 | (iw_handler) NULL, /* SIOCGIWSTATS */ | ||
2398 | iw_handler_set_spy, /* SIOCSIWSPY */ | ||
2399 | iw_handler_get_spy, /* SIOCGIWSPY */ | ||
2400 | iw_handler_set_thrspy, /* SIOCSIWTHRSPY */ | ||
2401 | iw_handler_get_thrspy, /* SIOCGIWTHRSPY */ | ||
2402 | (iw_handler) NULL, /* SIOCSIWAP */ | ||
2403 | (iw_handler) NULL, /* SIOCGIWAP */ | ||
2404 | (iw_handler) NULL, /* SIOCSIWMLME */ | ||
2405 | (iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */ | ||
2406 | (iw_handler) libertas_set_scan, /* SIOCSIWSCAN */ | ||
2407 | (iw_handler) libertas_get_scan, /* SIOCGIWSCAN */ | ||
2408 | (iw_handler) NULL, /* SIOCSIWESSID */ | ||
2409 | (iw_handler) NULL, /* SIOCGIWESSID */ | ||
2410 | (iw_handler) NULL, /* SIOCSIWNICKN */ | ||
2411 | (iw_handler) mesh_get_nick, /* SIOCGIWNICKN */ | ||
2412 | (iw_handler) NULL, /* -- hole -- */ | ||
2413 | (iw_handler) NULL, /* -- hole -- */ | ||
2414 | (iw_handler) wlan_set_rate, /* SIOCSIWRATE */ | ||
2415 | (iw_handler) wlan_get_rate, /* SIOCGIWRATE */ | ||
2416 | (iw_handler) wlan_set_rts, /* SIOCSIWRTS */ | ||
2417 | (iw_handler) wlan_get_rts, /* SIOCGIWRTS */ | ||
2418 | (iw_handler) wlan_set_frag, /* SIOCSIWFRAG */ | ||
2419 | (iw_handler) wlan_get_frag, /* SIOCGIWFRAG */ | ||
2420 | (iw_handler) wlan_set_txpow, /* SIOCSIWTXPOW */ | ||
2421 | (iw_handler) wlan_get_txpow, /* SIOCGIWTXPOW */ | ||
2422 | (iw_handler) wlan_set_retry, /* SIOCSIWRETRY */ | ||
2423 | (iw_handler) wlan_get_retry, /* SIOCGIWRETRY */ | ||
2424 | (iw_handler) wlan_set_encode, /* SIOCSIWENCODE */ | ||
2425 | (iw_handler) wlan_get_encode, /* SIOCGIWENCODE */ | ||
2426 | (iw_handler) wlan_set_power, /* SIOCSIWPOWER */ | ||
2427 | (iw_handler) wlan_get_power, /* SIOCGIWPOWER */ | ||
2428 | (iw_handler) NULL, /* -- hole -- */ | ||
2429 | (iw_handler) NULL, /* -- hole -- */ | ||
2430 | (iw_handler) wlan_set_genie, /* SIOCSIWGENIE */ | ||
2431 | (iw_handler) wlan_get_genie, /* SIOCGIWGENIE */ | ||
2432 | (iw_handler) wlan_set_auth, /* SIOCSIWAUTH */ | ||
2433 | (iw_handler) wlan_get_auth, /* SIOCGIWAUTH */ | ||
2434 | (iw_handler) wlan_set_encodeext,/* SIOCSIWENCODEEXT */ | ||
2435 | (iw_handler) wlan_get_encodeext,/* SIOCGIWENCODEEXT */ | ||
2436 | (iw_handler) NULL, /* SIOCSIWPMKSA */ | ||
2437 | }; | ||
2345 | struct iw_handler_def libertas_handler_def = { | 2438 | struct iw_handler_def libertas_handler_def = { |
2346 | .num_standard = sizeof(wlan_handler) / sizeof(iw_handler), | 2439 | .num_standard = sizeof(wlan_handler) / sizeof(iw_handler), |
2347 | .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler), | 2440 | .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler), |
@@ -2352,3 +2445,14 @@ struct iw_handler_def libertas_handler_def = { | |||
2352 | .private_args = (struct iw_priv_args *)wlan_private_args, | 2445 | .private_args = (struct iw_priv_args *)wlan_private_args, |
2353 | .get_wireless_stats = wlan_get_wireless_stats, | 2446 | .get_wireless_stats = wlan_get_wireless_stats, |
2354 | }; | 2447 | }; |
2448 | |||
2449 | struct iw_handler_def mesh_handler_def = { | ||
2450 | .num_standard = sizeof(mesh_wlan_handler) / sizeof(iw_handler), | ||
2451 | .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler), | ||
2452 | .num_private_args = sizeof(wlan_private_args) / | ||
2453 | sizeof(struct iw_priv_args), | ||
2454 | .standard = (iw_handler *) mesh_wlan_handler, | ||
2455 | .private = (iw_handler *) wlan_private_handler, | ||
2456 | .private_args = (struct iw_priv_args *)wlan_private_args, | ||
2457 | .get_wireless_stats = wlan_get_wireless_stats, | ||
2458 | }; | ||
diff --git a/drivers/net/wireless/libertas/wext.h b/drivers/net/wireless/libertas/wext.h index fb7e828dd9be..d555056b25b7 100644 --- a/drivers/net/wireless/libertas/wext.h +++ b/drivers/net/wireless/libertas/wext.h | |||
@@ -58,6 +58,7 @@ struct wlan_ioctl_regrdwr { | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | extern struct iw_handler_def libertas_handler_def; | 60 | extern struct iw_handler_def libertas_handler_def; |
61 | extern struct iw_handler_def mesh_handler_def; | ||
61 | int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int i); | 62 | int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int i); |
62 | int wlan_radio_ioctl(wlan_private * priv, u8 option); | 63 | int wlan_radio_ioctl(wlan_private * priv, u8 option); |
63 | 64 | ||