diff options
author | Holger Schurig <holgerschurig@googlemail.com> | 2009-12-02 09:26:02 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-22 13:44:02 -0500 |
commit | 4143a23de096910e3ceb0939f41de6ffb8c59475 (patch) | |
tree | d70d1f4b4c871ed4cea4817ede151ca47745a1c0 | |
parent | 602114ae595af6c89eab149cf9f939e3f7ef4a34 (diff) |
libertas: make mesh configurable
Mostly for the embedded people that know beforehand that they don't need
MESH at all and want to save some bytes, but also helpful for the upcoming
cfg80211 transition.
text data bss dec hex filename
114264 2308 140 116712 1c7e8 libertas.ko with mesh
105026 2000 140 107166 1a29e libertas.ko without mesh
--------------------------------------------------
-9238 -308 -9546
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/Kconfig | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/Makefile | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/dev.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/mesh.h | 17 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 20 |
7 files changed, 47 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/Kconfig b/drivers/net/wireless/libertas/Kconfig index 30aa9d48d67e..0485c9957575 100644 --- a/drivers/net/wireless/libertas/Kconfig +++ b/drivers/net/wireless/libertas/Kconfig | |||
@@ -37,3 +37,9 @@ config LIBERTAS_DEBUG | |||
37 | depends on LIBERTAS | 37 | depends on LIBERTAS |
38 | ---help--- | 38 | ---help--- |
39 | Debugging support. | 39 | Debugging support. |
40 | |||
41 | config LIBERTAS_MESH | ||
42 | bool "Enable mesh support" | ||
43 | depends on LIBERTAS | ||
44 | help | ||
45 | This enables Libertas' MESH support, used by e.g. the OLPC people. | ||
diff --git a/drivers/net/wireless/libertas/Makefile b/drivers/net/wireless/libertas/Makefile index b188cd97a053..45e870e33117 100644 --- a/drivers/net/wireless/libertas/Makefile +++ b/drivers/net/wireless/libertas/Makefile | |||
@@ -5,11 +5,11 @@ libertas-y += cmdresp.o | |||
5 | libertas-y += debugfs.o | 5 | libertas-y += debugfs.o |
6 | libertas-y += ethtool.o | 6 | libertas-y += ethtool.o |
7 | libertas-y += main.o | 7 | libertas-y += main.o |
8 | libertas-y += mesh.o | ||
9 | libertas-y += rx.o | 8 | libertas-y += rx.o |
10 | libertas-y += scan.o | 9 | libertas-y += scan.o |
11 | libertas-y += tx.o | 10 | libertas-y += tx.o |
12 | libertas-y += wext.o | 11 | libertas-y += wext.o |
12 | libertas-$(CONFIG_LIBERTAS_MESH) += mesh.o | ||
13 | 13 | ||
14 | usb8xxx-objs += if_usb.o | 14 | usb8xxx-objs += if_usb.o |
15 | libertas_cs-objs += if_cs.o | 15 | libertas_cs-objs += if_cs.o |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 4a198113f9be..4a0d8f4188ca 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -998,6 +998,8 @@ int lbs_prepare_and_send_command(struct lbs_private *priv, | |||
998 | ret = 0; | 998 | ret = 0; |
999 | break; | 999 | break; |
1000 | 1000 | ||
1001 | #ifdef CONFIG_LIBERTAS_MESH | ||
1002 | |||
1001 | case CMD_BT_ACCESS: | 1003 | case CMD_BT_ACCESS: |
1002 | ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf); | 1004 | ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf); |
1003 | break; | 1005 | break; |
@@ -1006,6 +1008,8 @@ int lbs_prepare_and_send_command(struct lbs_private *priv, | |||
1006 | ret = lbs_cmd_fwt_access(cmdptr, cmd_action, pdata_buf); | 1008 | ret = lbs_cmd_fwt_access(cmdptr, cmd_action, pdata_buf); |
1007 | break; | 1009 | break; |
1008 | 1010 | ||
1011 | #endif | ||
1012 | |||
1009 | case CMD_802_11_BEACON_CTRL: | 1013 | case CMD_802_11_BEACON_CTRL: |
1010 | ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action); | 1014 | ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action); |
1011 | break; | 1015 | break; |
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 159de3ec9c44..7330ab8521cc 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -39,12 +39,14 @@ struct lbs_private { | |||
39 | 39 | ||
40 | /* Mesh */ | 40 | /* Mesh */ |
41 | struct net_device *mesh_dev; /* Virtual device */ | 41 | struct net_device *mesh_dev; /* Virtual device */ |
42 | #ifdef CONFIG_LIBERTAS_MESH | ||
42 | u32 mesh_connect_status; | 43 | u32 mesh_connect_status; |
43 | struct lbs_mesh_stats mstats; | 44 | struct lbs_mesh_stats mstats; |
44 | int mesh_open; | 45 | int mesh_open; |
45 | uint16_t mesh_tlv; | 46 | uint16_t mesh_tlv; |
46 | u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1]; | 47 | u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1]; |
47 | u8 mesh_ssid_len; | 48 | u8 mesh_ssid_len; |
49 | #endif | ||
48 | 50 | ||
49 | /* Monitor mode */ | 51 | /* Monitor mode */ |
50 | struct net_device *rtap_net_dev; | 52 | struct net_device *rtap_net_dev; |
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c index 63d020374c2b..3804a58d7f4e 100644 --- a/drivers/net/wireless/libertas/ethtool.c +++ b/drivers/net/wireless/libertas/ethtool.c | |||
@@ -114,9 +114,11 @@ const struct ethtool_ops lbs_ethtool_ops = { | |||
114 | .get_drvinfo = lbs_ethtool_get_drvinfo, | 114 | .get_drvinfo = lbs_ethtool_get_drvinfo, |
115 | .get_eeprom = lbs_ethtool_get_eeprom, | 115 | .get_eeprom = lbs_ethtool_get_eeprom, |
116 | .get_eeprom_len = lbs_ethtool_get_eeprom_len, | 116 | .get_eeprom_len = lbs_ethtool_get_eeprom_len, |
117 | #ifdef CONFIG_LIBERTAS_MESH | ||
117 | .get_sset_count = lbs_mesh_ethtool_get_sset_count, | 118 | .get_sset_count = lbs_mesh_ethtool_get_sset_count, |
118 | .get_ethtool_stats = lbs_mesh_ethtool_get_stats, | 119 | .get_ethtool_stats = lbs_mesh_ethtool_get_stats, |
119 | .get_strings = lbs_mesh_ethtool_get_strings, | 120 | .get_strings = lbs_mesh_ethtool_get_strings, |
121 | #endif | ||
120 | .get_wol = lbs_ethtool_get_wol, | 122 | .get_wol = lbs_ethtool_get_wol, |
121 | .set_wol = lbs_ethtool_set_wol, | 123 | .set_wol = lbs_ethtool_set_wol, |
122 | }; | 124 | }; |
diff --git a/drivers/net/wireless/libertas/mesh.h b/drivers/net/wireless/libertas/mesh.h index 388c39281b7d..e2573303a328 100644 --- a/drivers/net/wireless/libertas/mesh.h +++ b/drivers/net/wireless/libertas/mesh.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #include <net/lib80211.h> | 9 | #include <net/lib80211.h> |
10 | 10 | ||
11 | 11 | ||
12 | #ifdef CONFIG_LIBERTAS_MESH | ||
13 | |||
12 | /* Mesh statistics */ | 14 | /* Mesh statistics */ |
13 | struct lbs_mesh_stats { | 15 | struct lbs_mesh_stats { |
14 | u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */ | 16 | u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */ |
@@ -89,5 +91,20 @@ void lbs_mesh_ethtool_get_strings(struct net_device *dev, | |||
89 | #define lbs_mesh_open(priv) (priv->mesh_open) | 91 | #define lbs_mesh_open(priv) (priv->mesh_open) |
90 | #define lbs_mesh_connected(priv) (priv->mesh_connect_status == LBS_CONNECTED) | 92 | #define lbs_mesh_connected(priv) (priv->mesh_connect_status == LBS_CONNECTED) |
91 | 93 | ||
94 | #else | ||
95 | |||
96 | #define lbs_init_mesh(priv) | ||
97 | #define lbs_deinit_mesh(priv) | ||
98 | #define lbs_add_mesh(priv) | ||
99 | #define lbs_remove_mesh(priv) | ||
100 | #define lbs_mesh_set_dev(priv, dev, rxpd) (dev) | ||
101 | #define lbs_mesh_set_txpd(priv, dev, txpd) | ||
102 | #define lbs_mesh_config(priv, enable, chan) | ||
103 | #define lbs_mesh_open(priv) (0) | ||
104 | #define lbs_mesh_connected(priv) (0) | ||
105 | |||
106 | #endif | ||
107 | |||
108 | |||
92 | 109 | ||
93 | #endif | 110 | #endif |
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index c0c7bc40b109..f07ba0b6c5f1 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -298,6 +298,7 @@ static int lbs_get_nick(struct net_device *dev, struct iw_request_info *info, | |||
298 | return 0; | 298 | return 0; |
299 | } | 299 | } |
300 | 300 | ||
301 | #ifdef CONFIG_LIBERTAS_MESH | ||
301 | static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, | 302 | static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, |
302 | struct iw_point *dwrq, char *extra) | 303 | struct iw_point *dwrq, char *extra) |
303 | { | 304 | { |
@@ -321,6 +322,7 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, | |||
321 | lbs_deb_leave(LBS_DEB_WEXT); | 322 | lbs_deb_leave(LBS_DEB_WEXT); |
322 | return 0; | 323 | return 0; |
323 | } | 324 | } |
325 | #endif | ||
324 | 326 | ||
325 | static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info, | 327 | static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info, |
326 | struct iw_param *vwrq, char *extra) | 328 | struct iw_param *vwrq, char *extra) |
@@ -422,6 +424,7 @@ static int lbs_get_mode(struct net_device *dev, | |||
422 | return 0; | 424 | return 0; |
423 | } | 425 | } |
424 | 426 | ||
427 | #ifdef CONFIG_LIBERTAS_MESH | ||
425 | static int mesh_wlan_get_mode(struct net_device *dev, | 428 | static int mesh_wlan_get_mode(struct net_device *dev, |
426 | struct iw_request_info *info, u32 * uwrq, | 429 | struct iw_request_info *info, u32 * uwrq, |
427 | char *extra) | 430 | char *extra) |
@@ -433,6 +436,7 @@ static int mesh_wlan_get_mode(struct net_device *dev, | |||
433 | lbs_deb_leave(LBS_DEB_WEXT); | 436 | lbs_deb_leave(LBS_DEB_WEXT); |
434 | return 0; | 437 | return 0; |
435 | } | 438 | } |
439 | #endif | ||
436 | 440 | ||
437 | static int lbs_get_txpow(struct net_device *dev, | 441 | static int lbs_get_txpow(struct net_device *dev, |
438 | struct iw_request_info *info, | 442 | struct iw_request_info *info, |
@@ -1010,6 +1014,7 @@ out: | |||
1010 | return ret; | 1014 | return ret; |
1011 | } | 1015 | } |
1012 | 1016 | ||
1017 | #ifdef CONFIG_LIBERTAS_MESH | ||
1013 | static int lbs_mesh_set_freq(struct net_device *dev, | 1018 | static int lbs_mesh_set_freq(struct net_device *dev, |
1014 | struct iw_request_info *info, | 1019 | struct iw_request_info *info, |
1015 | struct iw_freq *fwrq, char *extra) | 1020 | struct iw_freq *fwrq, char *extra) |
@@ -1061,6 +1066,7 @@ out: | |||
1061 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | 1066 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); |
1062 | return ret; | 1067 | return ret; |
1063 | } | 1068 | } |
1069 | #endif | ||
1064 | 1070 | ||
1065 | static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info, | 1071 | static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info, |
1066 | struct iw_param *vwrq, char *extra) | 1072 | struct iw_param *vwrq, char *extra) |
@@ -2110,6 +2116,7 @@ out: | |||
2110 | return ret; | 2116 | return ret; |
2111 | } | 2117 | } |
2112 | 2118 | ||
2119 | #ifdef CONFIG_LIBERTAS_MESH | ||
2113 | static int lbs_mesh_get_essid(struct net_device *dev, | 2120 | static int lbs_mesh_get_essid(struct net_device *dev, |
2114 | struct iw_request_info *info, | 2121 | struct iw_request_info *info, |
2115 | struct iw_point *dwrq, char *extra) | 2122 | struct iw_point *dwrq, char *extra) |
@@ -2163,6 +2170,7 @@ static int lbs_mesh_set_essid(struct net_device *dev, | |||
2163 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | 2170 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); |
2164 | return ret; | 2171 | return ret; |
2165 | } | 2172 | } |
2173 | #endif | ||
2166 | 2174 | ||
2167 | /** | 2175 | /** |
2168 | * @brief Connect to the AP or Ad-hoc Network with specific bssid | 2176 | * @brief Connect to the AP or Ad-hoc Network with specific bssid |
@@ -2269,7 +2277,13 @@ static const iw_handler lbs_handler[] = { | |||
2269 | (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ | 2277 | (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ |
2270 | (iw_handler) NULL, /* SIOCSIWPMKSA */ | 2278 | (iw_handler) NULL, /* SIOCSIWPMKSA */ |
2271 | }; | 2279 | }; |
2280 | struct iw_handler_def lbs_handler_def = { | ||
2281 | .num_standard = ARRAY_SIZE(lbs_handler), | ||
2282 | .standard = (iw_handler *) lbs_handler, | ||
2283 | .get_wireless_stats = lbs_get_wireless_stats, | ||
2284 | }; | ||
2272 | 2285 | ||
2286 | #ifdef CONFIG_LIBERTAS_MESH | ||
2273 | static const iw_handler mesh_wlan_handler[] = { | 2287 | static const iw_handler mesh_wlan_handler[] = { |
2274 | (iw_handler) NULL, /* SIOCSIWCOMMIT */ | 2288 | (iw_handler) NULL, /* SIOCSIWCOMMIT */ |
2275 | (iw_handler) lbs_get_name, /* SIOCGIWNAME */ | 2289 | (iw_handler) lbs_get_name, /* SIOCGIWNAME */ |
@@ -2327,14 +2341,10 @@ static const iw_handler mesh_wlan_handler[] = { | |||
2327 | (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ | 2341 | (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ |
2328 | (iw_handler) NULL, /* SIOCSIWPMKSA */ | 2342 | (iw_handler) NULL, /* SIOCSIWPMKSA */ |
2329 | }; | 2343 | }; |
2330 | struct iw_handler_def lbs_handler_def = { | ||
2331 | .num_standard = ARRAY_SIZE(lbs_handler), | ||
2332 | .standard = (iw_handler *) lbs_handler, | ||
2333 | .get_wireless_stats = lbs_get_wireless_stats, | ||
2334 | }; | ||
2335 | 2344 | ||
2336 | struct iw_handler_def mesh_handler_def = { | 2345 | struct iw_handler_def mesh_handler_def = { |
2337 | .num_standard = ARRAY_SIZE(mesh_wlan_handler), | 2346 | .num_standard = ARRAY_SIZE(mesh_wlan_handler), |
2338 | .standard = (iw_handler *) mesh_wlan_handler, | 2347 | .standard = (iw_handler *) mesh_wlan_handler, |
2339 | .get_wireless_stats = lbs_get_wireless_stats, | 2348 | .get_wireless_stats = lbs_get_wireless_stats, |
2340 | }; | 2349 | }; |
2350 | #endif | ||