aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2008-03-26 12:56:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-01 17:13:17 -0400
commit04850a47aa7d03cbf651a91262fdaa9f18373dfc (patch)
tree2cfb6ef447bdae044bc049cae89dd331ebbd0833 /drivers/net/wireless/libertas/main.c
parentf539f2efe9fdf9e7db2022a757190858576d34fd (diff)
libertas: don't depend on IEEE80211
Runtime-wise we only need escape_ssid from the deprecated IEEE80211 subsystem. However, it's easy to provide our own copy. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index efff63fb6b66..6c2af176da20 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1559,6 +1559,32 @@ out:
1559 return ret; 1559 return ret;
1560} 1560}
1561 1561
1562#ifndef CONFIG_IEEE80211
1563const char *escape_essid(const char *essid, u8 essid_len)
1564{
1565 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
1566 const char *s = essid;
1567 char *d = escaped;
1568
1569 if (ieee80211_is_empty_essid(essid, essid_len)) {
1570 memcpy(escaped, "<hidden>", sizeof("<hidden>"));
1571 return escaped;
1572 }
1573
1574 essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
1575 while (essid_len--) {
1576 if (*s == '\0') {
1577 *d++ = '\\';
1578 *d++ = '0';
1579 s++;
1580 } else {
1581 *d++ = *s++;
1582 }
1583 }
1584 *d = '\0';
1585 return escaped;
1586}
1587#endif
1562 1588
1563module_init(lbs_init_module); 1589module_init(lbs_init_module);
1564module_exit(lbs_exit_module); 1590module_exit(lbs_exit_module);