diff options
author | John W. Linville <linville@tuxdriver.com> | 2008-09-30 20:59:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:50 -0400 |
commit | 9387b7caf3049168fc97a8a9111af8fe2143af18 (patch) | |
tree | 6a19e5477d6a6badf19788536a9d3e1913ae48e1 /drivers/net/wireless/libertas | |
parent | 2819f8ad6da1e24b5dd94a221978e61f2a9c972a (diff) |
wireless: use individual buffers for printing ssid values
Also change escape_ssid to print_ssid to match print_mac semantics.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/debugfs.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 3 |
5 files changed, 26 insertions, 13 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 3492e89d1dd5..92863780286f 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -153,17 +153,18 @@ static int lbs_adhoc_join(struct lbs_private *priv, | |||
153 | struct cmd_ds_802_11_ad_hoc_join cmd; | 153 | struct cmd_ds_802_11_ad_hoc_join cmd; |
154 | struct bss_descriptor *bss = &assoc_req->bss; | 154 | struct bss_descriptor *bss = &assoc_req->bss; |
155 | u8 preamble = RADIO_PREAMBLE_LONG; | 155 | u8 preamble = RADIO_PREAMBLE_LONG; |
156 | DECLARE_SSID_BUF(ssid); | ||
156 | u16 ratesize = 0; | 157 | u16 ratesize = 0; |
157 | int ret = 0; | 158 | int ret = 0; |
158 | 159 | ||
159 | lbs_deb_enter(LBS_DEB_ASSOC); | 160 | lbs_deb_enter(LBS_DEB_ASSOC); |
160 | 161 | ||
161 | lbs_deb_join("current SSID '%s', ssid length %u\n", | 162 | lbs_deb_join("current SSID '%s', ssid length %u\n", |
162 | escape_ssid(priv->curbssparams.ssid, | 163 | print_ssid(ssid, priv->curbssparams.ssid, |
163 | priv->curbssparams.ssid_len), | 164 | priv->curbssparams.ssid_len), |
164 | priv->curbssparams.ssid_len); | 165 | priv->curbssparams.ssid_len); |
165 | lbs_deb_join("requested ssid '%s', ssid length %u\n", | 166 | lbs_deb_join("requested ssid '%s', ssid length %u\n", |
166 | escape_ssid(bss->ssid, bss->ssid_len), | 167 | print_ssid(ssid, bss->ssid, bss->ssid_len), |
167 | bss->ssid_len); | 168 | bss->ssid_len); |
168 | 169 | ||
169 | /* check if the requested SSID is already joined */ | 170 | /* check if the requested SSID is already joined */ |
@@ -308,6 +309,7 @@ static int lbs_adhoc_start(struct lbs_private *priv, | |||
308 | size_t ratesize = 0; | 309 | size_t ratesize = 0; |
309 | u16 tmpcap = 0; | 310 | u16 tmpcap = 0; |
310 | int ret = 0; | 311 | int ret = 0; |
312 | DECLARE_SSID_BUF(ssid); | ||
311 | 313 | ||
312 | lbs_deb_enter(LBS_DEB_ASSOC); | 314 | lbs_deb_enter(LBS_DEB_ASSOC); |
313 | 315 | ||
@@ -327,7 +329,7 @@ static int lbs_adhoc_start(struct lbs_private *priv, | |||
327 | memcpy(cmd.ssid, assoc_req->ssid, assoc_req->ssid_len); | 329 | memcpy(cmd.ssid, assoc_req->ssid, assoc_req->ssid_len); |
328 | 330 | ||
329 | lbs_deb_join("ADHOC_START: SSID '%s', ssid length %u\n", | 331 | lbs_deb_join("ADHOC_START: SSID '%s', ssid length %u\n", |
330 | escape_ssid(assoc_req->ssid, assoc_req->ssid_len), | 332 | print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len), |
331 | assoc_req->ssid_len); | 333 | assoc_req->ssid_len); |
332 | 334 | ||
333 | cmd.bsstype = CMD_BSS_TYPE_IBSS; | 335 | cmd.bsstype = CMD_BSS_TYPE_IBSS; |
@@ -695,6 +697,7 @@ static int assoc_helper_essid(struct lbs_private *priv, | |||
695 | int ret = 0; | 697 | int ret = 0; |
696 | struct bss_descriptor * bss; | 698 | struct bss_descriptor * bss; |
697 | int channel = -1; | 699 | int channel = -1; |
700 | DECLARE_SSID_BUF(ssid); | ||
698 | 701 | ||
699 | lbs_deb_enter(LBS_DEB_ASSOC); | 702 | lbs_deb_enter(LBS_DEB_ASSOC); |
700 | 703 | ||
@@ -706,7 +709,7 @@ static int assoc_helper_essid(struct lbs_private *priv, | |||
706 | channel = assoc_req->channel; | 709 | channel = assoc_req->channel; |
707 | 710 | ||
708 | lbs_deb_assoc("SSID '%s' requested\n", | 711 | lbs_deb_assoc("SSID '%s' requested\n", |
709 | escape_ssid(assoc_req->ssid, assoc_req->ssid_len)); | 712 | print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len)); |
710 | if (assoc_req->mode == IW_MODE_INFRA) { | 713 | if (assoc_req->mode == IW_MODE_INFRA) { |
711 | lbs_send_specific_ssid_scan(priv, assoc_req->ssid, | 714 | lbs_send_specific_ssid_scan(priv, assoc_req->ssid, |
712 | assoc_req->ssid_len); | 715 | assoc_req->ssid_len); |
@@ -1207,6 +1210,7 @@ void lbs_association_worker(struct work_struct *work) | |||
1207 | struct assoc_request * assoc_req = NULL; | 1210 | struct assoc_request * assoc_req = NULL; |
1208 | int ret = 0; | 1211 | int ret = 0; |
1209 | int find_any_ssid = 0; | 1212 | int find_any_ssid = 0; |
1213 | DECLARE_SSID_BUF(ssid); | ||
1210 | 1214 | ||
1211 | lbs_deb_enter(LBS_DEB_ASSOC); | 1215 | lbs_deb_enter(LBS_DEB_ASSOC); |
1212 | 1216 | ||
@@ -1230,7 +1234,7 @@ void lbs_association_worker(struct work_struct *work) | |||
1230 | " secinfo: %s%s%s\n" | 1234 | " secinfo: %s%s%s\n" |
1231 | " auth_mode: %d\n", | 1235 | " auth_mode: %d\n", |
1232 | assoc_req->flags, | 1236 | assoc_req->flags, |
1233 | escape_ssid(assoc_req->ssid, assoc_req->ssid_len), | 1237 | print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len), |
1234 | assoc_req->channel, assoc_req->band, assoc_req->mode, | 1238 | assoc_req->channel, assoc_req->band, assoc_req->mode, |
1235 | assoc_req->bssid, | 1239 | assoc_req->bssid, |
1236 | assoc_req->secinfo.WPAenabled ? " WPA" : "", | 1240 | assoc_req->secinfo.WPAenabled ? " WPA" : "", |
@@ -1767,6 +1771,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp) | |||
1767 | struct cmd_ds_802_11_ad_hoc_result *adhoc_resp; | 1771 | struct cmd_ds_802_11_ad_hoc_result *adhoc_resp; |
1768 | union iwreq_data wrqu; | 1772 | union iwreq_data wrqu; |
1769 | struct bss_descriptor *bss; | 1773 | struct bss_descriptor *bss; |
1774 | DECLARE_SSID_BUF(ssid); | ||
1770 | 1775 | ||
1771 | lbs_deb_enter(LBS_DEB_JOIN); | 1776 | lbs_deb_enter(LBS_DEB_JOIN); |
1772 | 1777 | ||
@@ -1816,7 +1821,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp) | |||
1816 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); | 1821 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); |
1817 | 1822 | ||
1818 | lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n", | 1823 | lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n", |
1819 | escape_ssid(bss->ssid, bss->ssid_len), | 1824 | print_ssid(ssid, bss->ssid, bss->ssid_len), |
1820 | priv->curbssparams.bssid, | 1825 | priv->curbssparams.bssid, |
1821 | priv->curbssparams.channel); | 1826 | priv->curbssparams.channel); |
1822 | 1827 | ||
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 52feab69ee49..38843c8b919c 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -1063,6 +1063,7 @@ int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan) | |||
1063 | { | 1063 | { |
1064 | struct cmd_ds_mesh_config cmd; | 1064 | struct cmd_ds_mesh_config cmd; |
1065 | struct mrvl_meshie *ie; | 1065 | struct mrvl_meshie *ie; |
1066 | DECLARE_SSID_BUF(ssid); | ||
1066 | 1067 | ||
1067 | memset(&cmd, 0, sizeof(cmd)); | 1068 | memset(&cmd, 0, sizeof(cmd)); |
1068 | cmd.channel = cpu_to_le16(chan); | 1069 | cmd.channel = cpu_to_le16(chan); |
@@ -1093,7 +1094,7 @@ int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan) | |||
1093 | } | 1094 | } |
1094 | lbs_deb_cmd("mesh config action %d type %x channel %d SSID %s\n", | 1095 | lbs_deb_cmd("mesh config action %d type %x channel %d SSID %s\n", |
1095 | action, priv->mesh_tlv, chan, | 1096 | action, priv->mesh_tlv, chan, |
1096 | escape_ssid(priv->mesh_ssid, priv->mesh_ssid_len)); | 1097 | print_ssid(ssid, priv->mesh_ssid, priv->mesh_ssid_len)); |
1097 | 1098 | ||
1098 | return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv); | 1099 | return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv); |
1099 | } | 1100 | } |
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index 84933203be74..ec4efd7ff3c8 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c | |||
@@ -66,6 +66,7 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, | |||
66 | int numscansdone = 0, res; | 66 | int numscansdone = 0, res; |
67 | unsigned long addr = get_zeroed_page(GFP_KERNEL); | 67 | unsigned long addr = get_zeroed_page(GFP_KERNEL); |
68 | char *buf = (char *)addr; | 68 | char *buf = (char *)addr; |
69 | DECLARE_SSID_BUF(ssid); | ||
69 | struct bss_descriptor * iter_bss; | 70 | struct bss_descriptor * iter_bss; |
70 | 71 | ||
71 | pos += snprintf(buf+pos, len-pos, | 72 | pos += snprintf(buf+pos, len-pos, |
@@ -86,7 +87,8 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, | |||
86 | spectrum_mgmt ? 'S' : ' '); | 87 | spectrum_mgmt ? 'S' : ' '); |
87 | pos += snprintf(buf+pos, len-pos, " %04d |", SCAN_RSSI(iter_bss->rssi)); | 88 | pos += snprintf(buf+pos, len-pos, " %04d |", SCAN_RSSI(iter_bss->rssi)); |
88 | pos += snprintf(buf+pos, len-pos, " %s\n", | 89 | pos += snprintf(buf+pos, len-pos, " %s\n", |
89 | escape_ssid(iter_bss->ssid, iter_bss->ssid_len)); | 90 | print_ssid(ssid, iter_bss->ssid, |
91 | iter_bss->ssid_len)); | ||
90 | 92 | ||
91 | numscansdone++; | 93 | numscansdone++; |
92 | } | 94 | } |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 7881890a4e98..5c34ac588189 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -362,6 +362,7 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan) | |||
362 | #ifdef CONFIG_LIBERTAS_DEBUG | 362 | #ifdef CONFIG_LIBERTAS_DEBUG |
363 | struct bss_descriptor *iter; | 363 | struct bss_descriptor *iter; |
364 | int i = 0; | 364 | int i = 0; |
365 | DECLARE_SSID_BUF(ssid); | ||
365 | #endif | 366 | #endif |
366 | 367 | ||
367 | lbs_deb_enter_args(LBS_DEB_SCAN, "full_scan %d", full_scan); | 368 | lbs_deb_enter_args(LBS_DEB_SCAN, "full_scan %d", full_scan); |
@@ -455,7 +456,7 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan) | |||
455 | list_for_each_entry(iter, &priv->network_list, list) | 456 | list_for_each_entry(iter, &priv->network_list, list) |
456 | lbs_deb_scan("%02d: BSSID %pM, RSSI %d, SSID '%s'\n", | 457 | lbs_deb_scan("%02d: BSSID %pM, RSSI %d, SSID '%s'\n", |
457 | i++, iter->bssid, iter->rssi, | 458 | i++, iter->bssid, iter->rssi, |
458 | escape_ssid(iter->ssid, iter->ssid_len)); | 459 | print_ssid(ssid, iter->ssid, iter->ssid_len)); |
459 | mutex_unlock(&priv->lock); | 460 | mutex_unlock(&priv->lock); |
460 | #endif | 461 | #endif |
461 | 462 | ||
@@ -514,6 +515,7 @@ static int lbs_process_bss(struct bss_descriptor *bss, | |||
514 | struct ieeetypes_dsparamset *pDS; | 515 | struct ieeetypes_dsparamset *pDS; |
515 | struct ieeetypes_cfparamset *pCF; | 516 | struct ieeetypes_cfparamset *pCF; |
516 | struct ieeetypes_ibssparamset *pibss; | 517 | struct ieeetypes_ibssparamset *pibss; |
518 | DECLARE_SSID_BUF(ssid); | ||
517 | struct ieeetypes_countryinfoset *pcountryinfo; | 519 | struct ieeetypes_countryinfoset *pcountryinfo; |
518 | uint8_t *pos, *end, *p; | 520 | uint8_t *pos, *end, *p; |
519 | uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; | 521 | uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; |
@@ -602,7 +604,7 @@ static int lbs_process_bss(struct bss_descriptor *bss, | |||
602 | bss->ssid_len = min_t(int, 32, elem->len); | 604 | bss->ssid_len = min_t(int, 32, elem->len); |
603 | memcpy(bss->ssid, elem->data, bss->ssid_len); | 605 | memcpy(bss->ssid, elem->data, bss->ssid_len); |
604 | lbs_deb_scan("got SSID IE: '%s', len %u\n", | 606 | lbs_deb_scan("got SSID IE: '%s', len %u\n", |
605 | escape_ssid(bss->ssid, bss->ssid_len), | 607 | print_ssid(ssid, bss->ssid, bss->ssid_len), |
606 | bss->ssid_len); | 608 | bss->ssid_len); |
607 | break; | 609 | break; |
608 | 610 | ||
@@ -742,10 +744,11 @@ done: | |||
742 | int lbs_send_specific_ssid_scan(struct lbs_private *priv, uint8_t *ssid, | 744 | int lbs_send_specific_ssid_scan(struct lbs_private *priv, uint8_t *ssid, |
743 | uint8_t ssid_len) | 745 | uint8_t ssid_len) |
744 | { | 746 | { |
747 | DECLARE_SSID_BUF(ssid_buf); | ||
745 | int ret = 0; | 748 | int ret = 0; |
746 | 749 | ||
747 | lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s'\n", | 750 | lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s'\n", |
748 | escape_ssid(ssid, ssid_len)); | 751 | print_ssid(ssid_buf, ssid, ssid_len)); |
749 | 752 | ||
750 | if (!ssid_len) | 753 | if (!ssid_len) |
751 | goto out; | 754 | goto out; |
@@ -940,6 +943,7 @@ out: | |||
940 | int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, | 943 | int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, |
941 | union iwreq_data *wrqu, char *extra) | 944 | union iwreq_data *wrqu, char *extra) |
942 | { | 945 | { |
946 | DECLARE_SSID_BUF(ssid); | ||
943 | struct lbs_private *priv = dev->priv; | 947 | struct lbs_private *priv = dev->priv; |
944 | int ret = 0; | 948 | int ret = 0; |
945 | 949 | ||
@@ -969,7 +973,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, | |||
969 | priv->scan_ssid_len = req->essid_len; | 973 | priv->scan_ssid_len = req->essid_len; |
970 | memcpy(priv->scan_ssid, req->essid, priv->scan_ssid_len); | 974 | memcpy(priv->scan_ssid, req->essid, priv->scan_ssid_len); |
971 | lbs_deb_wext("set_scan, essid '%s'\n", | 975 | lbs_deb_wext("set_scan, essid '%s'\n", |
972 | escape_ssid(priv->scan_ssid, priv->scan_ssid_len)); | 976 | print_ssid(ssid, priv->scan_ssid, priv->scan_ssid_len)); |
973 | } else { | 977 | } else { |
974 | priv->scan_ssid_len = 0; | 978 | priv->scan_ssid_len = 0; |
975 | } | 979 | } |
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 247579951858..d4c6a659b562 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -1978,6 +1978,7 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info, | |||
1978 | u8 ssid_len = 0; | 1978 | u8 ssid_len = 0; |
1979 | struct assoc_request * assoc_req; | 1979 | struct assoc_request * assoc_req; |
1980 | int in_ssid_len = dwrq->length; | 1980 | int in_ssid_len = dwrq->length; |
1981 | DECLARE_SSID_BUF(ssid_buf); | ||
1981 | 1982 | ||
1982 | lbs_deb_enter(LBS_DEB_WEXT); | 1983 | lbs_deb_enter(LBS_DEB_WEXT); |
1983 | 1984 | ||
@@ -2006,7 +2007,7 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info, | |||
2006 | lbs_deb_wext("requested any SSID\n"); | 2007 | lbs_deb_wext("requested any SSID\n"); |
2007 | } else { | 2008 | } else { |
2008 | lbs_deb_wext("requested SSID '%s'\n", | 2009 | lbs_deb_wext("requested SSID '%s'\n", |
2009 | escape_ssid(ssid, ssid_len)); | 2010 | print_ssid(ssid_buf, ssid, ssid_len)); |
2010 | } | 2011 | } |
2011 | 2012 | ||
2012 | out: | 2013 | out: |