Commit 04799fae authored by Holger Schurig's avatar Holger Schurig Committed by David S. Miller

[PATCH] libertas: let get nick return what set nick has set

Make the get-nickname wireless extension actually work. Before
this patch, I could do "iwconfig eth1 nick BLAH" but "iwconfig
eth1" would have still showed "MRVL-USB8388" to me. Hey, and that
was wrong anyway, I'm on a CF card, not on USB :-)
Signed-off-by: default avatarHolger Schurig <hs4233@mail.mn-solutions.de>
Acked-By: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent cc326137
...@@ -237,37 +237,16 @@ static int wlan_set_nick(struct net_device *dev, struct iw_request_info *info, ...@@ -237,37 +237,16 @@ static int wlan_set_nick(struct net_device *dev, struct iw_request_info *info,
static int wlan_get_nick(struct net_device *dev, struct iw_request_info *info, static int wlan_get_nick(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra) struct iw_point *dwrq, char *extra)
{ {
const char *cp; wlan_private *priv = dev->priv;
char comm[6] = { "COMM-" }; wlan_adapter *adapter = priv->adapter;
char mrvl[6] = { "MRVL-" };
int cnt;
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
/* dwrq->length = strlen(adapter->nodename);
* Nick Name is not used internally in this mode, memcpy(extra, adapter->nodename, dwrq->length);
* therefore return something useful instead. Jean II extra[dwrq->length] = '\0';
*/
strcpy(extra, mrvl);
cp = strstr(libertas_driver_version, comm);
if (cp == libertas_driver_version) //skip leading "COMM-"
cp = libertas_driver_version + strlen(comm);
else
cp = libertas_driver_version;
cnt = strlen(mrvl); dwrq->flags = 1; /* active */
extra += cnt;
while (cnt < 16 && (*cp != '-')) {
*extra++ = toupper(*cp++);
cnt++;
}
/*
* Push it out !
*/
dwrq->length = cnt;
lbs_deb_leave(LBS_DEB_WEXT); lbs_deb_leave(LBS_DEB_WEXT);
return 0; return 0;
...@@ -297,6 +276,7 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, ...@@ -297,6 +276,7 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info,
lbs_deb_leave(LBS_DEB_WEXT); lbs_deb_leave(LBS_DEB_WEXT);
return 0; return 0;
} }
static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra) struct iw_param *vwrq, char *extra)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment