diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-11 19:30:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:06:56 -0500 |
commit | f5956bf1e4575175135d636db1b7f3ab950e0dc3 (patch) | |
tree | 31ee0c222b0f0f6fe56f3645589090c1166eafa0 /drivers/net/wireless/libertas/wext.c | |
parent | 387a1f046fcaf299d93bb6de81257670a4442648 (diff) |
libertas: allow get/set SSID on mshX device
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index e44c0ce804ed..0a060726cf32 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -1917,6 +1917,54 @@ out: | |||
1917 | return ret; | 1917 | return ret; |
1918 | } | 1918 | } |
1919 | 1919 | ||
1920 | static int lbs_mesh_get_essid(struct net_device *dev, | ||
1921 | struct iw_request_info *info, | ||
1922 | struct iw_point *dwrq, char *extra) | ||
1923 | { | ||
1924 | struct lbs_private *priv = dev->priv; | ||
1925 | |||
1926 | lbs_deb_enter(LBS_DEB_WEXT); | ||
1927 | |||
1928 | memcpy(extra, priv->mesh_ssid, priv->mesh_ssid_len); | ||
1929 | |||
1930 | dwrq->length = priv->mesh_ssid_len; | ||
1931 | |||
1932 | dwrq->flags = 1; /* active */ | ||
1933 | |||
1934 | lbs_deb_leave(LBS_DEB_WEXT); | ||
1935 | return 0; | ||
1936 | } | ||
1937 | |||
1938 | static int lbs_mesh_set_essid(struct net_device *dev, | ||
1939 | struct iw_request_info *info, | ||
1940 | struct iw_point *dwrq, char *extra) | ||
1941 | { | ||
1942 | struct lbs_private *priv = dev->priv; | ||
1943 | int ret = 0; | ||
1944 | |||
1945 | lbs_deb_enter(LBS_DEB_WEXT); | ||
1946 | |||
1947 | /* Check the size of the string */ | ||
1948 | if (dwrq->length > IW_ESSID_MAX_SIZE) { | ||
1949 | ret = -E2BIG; | ||
1950 | goto out; | ||
1951 | } | ||
1952 | |||
1953 | if (!dwrq->flags || !dwrq->length) { | ||
1954 | ret = -EINVAL; | ||
1955 | goto out; | ||
1956 | } else { | ||
1957 | /* Specific SSID requested */ | ||
1958 | memcpy(priv->mesh_ssid, extra, dwrq->length); | ||
1959 | priv->mesh_ssid_len = dwrq->length; | ||
1960 | } | ||
1961 | |||
1962 | lbs_mesh_config(priv, 1); | ||
1963 | out: | ||
1964 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
1965 | return ret; | ||
1966 | } | ||
1967 | |||
1920 | /** | 1968 | /** |
1921 | * @brief Connect to the AP or Ad-hoc Network with specific bssid | 1969 | * @brief Connect to the AP or Ad-hoc Network with specific bssid |
1922 | * | 1970 | * |
@@ -2071,8 +2119,8 @@ static const iw_handler mesh_wlan_handler[] = { | |||
2071 | (iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */ | 2119 | (iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */ |
2072 | (iw_handler) lbs_set_scan, /* SIOCSIWSCAN */ | 2120 | (iw_handler) lbs_set_scan, /* SIOCSIWSCAN */ |
2073 | (iw_handler) lbs_get_scan, /* SIOCGIWSCAN */ | 2121 | (iw_handler) lbs_get_scan, /* SIOCGIWSCAN */ |
2074 | (iw_handler) NULL, /* SIOCSIWESSID */ | 2122 | (iw_handler) lbs_mesh_set_essid,/* SIOCSIWESSID */ |
2075 | (iw_handler) NULL, /* SIOCGIWESSID */ | 2123 | (iw_handler) lbs_mesh_get_essid,/* SIOCGIWESSID */ |
2076 | (iw_handler) NULL, /* SIOCSIWNICKN */ | 2124 | (iw_handler) NULL, /* SIOCSIWNICKN */ |
2077 | (iw_handler) mesh_get_nick, /* SIOCGIWNICKN */ | 2125 | (iw_handler) mesh_get_nick, /* SIOCGIWNICKN */ |
2078 | (iw_handler) NULL, /* -- hole -- */ | 2126 | (iw_handler) NULL, /* -- hole -- */ |