diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2009-07-30 12:41:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-04 16:44:17 -0400 |
commit | 2a4901bcbe9c122bd56e1f6c337fcb4ad75fafb7 (patch) | |
tree | 428a5163b3d925d2d5b9a31c1e7d5bc6ecb149b6 /drivers/net/usb | |
parent | 27b7b5c131a1df6701a96e10d1056de8e3b15aa9 (diff) |
rndis_host: allow rndis_wlan to see all indications
Allow rndis_wlan to see all indications. Currently rndis_host lets rndis_wlan to
know about link state changes only, but there is whole set of other
802.11-specific indications that rndis_wlan should handle properly. So rename
link_change() to indication() and convert rndis_wlan to use it.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/rndis_host.c | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 2232232b7989..d032bba9bc4c 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -65,6 +65,32 @@ void rndis_status(struct usbnet *dev, struct urb *urb) | |||
65 | EXPORT_SYMBOL_GPL(rndis_status); | 65 | EXPORT_SYMBOL_GPL(rndis_status); |
66 | 66 | ||
67 | /* | 67 | /* |
68 | * RNDIS indicate messages. | ||
69 | */ | ||
70 | static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg, | ||
71 | int buflen) | ||
72 | { | ||
73 | struct cdc_state *info = (void *)&dev->data; | ||
74 | struct device *udev = &info->control->dev; | ||
75 | |||
76 | if (dev->driver_info->indication) { | ||
77 | dev->driver_info->indication(dev, msg, buflen); | ||
78 | } else { | ||
79 | switch (msg->status) { | ||
80 | case RNDIS_STATUS_MEDIA_CONNECT: | ||
81 | dev_info(udev, "rndis media connect\n"); | ||
82 | break; | ||
83 | case RNDIS_STATUS_MEDIA_DISCONNECT: | ||
84 | dev_info(udev, "rndis media disconnect\n"); | ||
85 | break; | ||
86 | default: | ||
87 | dev_info(udev, "rndis indication: 0x%08x\n", | ||
88 | le32_to_cpu(msg->status)); | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | |||
93 | /* | ||
68 | * RPC done RNDIS-style. Caller guarantees: | 94 | * RPC done RNDIS-style. Caller guarantees: |
69 | * - message is properly byteswapped | 95 | * - message is properly byteswapped |
70 | * - there's no other request pending | 96 | * - there's no other request pending |
@@ -143,27 +169,9 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
143 | request_id, xid); | 169 | request_id, xid); |
144 | /* then likely retry */ | 170 | /* then likely retry */ |
145 | } else switch (buf->msg_type) { | 171 | } else switch (buf->msg_type) { |
146 | case RNDIS_MSG_INDICATE: { /* fault/event */ | 172 | case RNDIS_MSG_INDICATE: /* fault/event */ |
147 | struct rndis_indicate *msg = (void *)buf; | 173 | rndis_msg_indicate(dev, (void *)buf, buflen); |
148 | int state = 0; | 174 | |
149 | |||
150 | switch (msg->status) { | ||
151 | case RNDIS_STATUS_MEDIA_CONNECT: | ||
152 | state = 1; | ||
153 | case RNDIS_STATUS_MEDIA_DISCONNECT: | ||
154 | dev_info(&info->control->dev, | ||
155 | "rndis media %sconnect\n", | ||
156 | !state?"dis":""); | ||
157 | if (dev->driver_info->link_change) | ||
158 | dev->driver_info->link_change( | ||
159 | dev, state); | ||
160 | break; | ||
161 | default: | ||
162 | dev_info(&info->control->dev, | ||
163 | "rndis indication: 0x%08x\n", | ||
164 | le32_to_cpu(msg->status)); | ||
165 | } | ||
166 | } | ||
167 | break; | 175 | break; |
168 | case RNDIS_MSG_KEEPALIVE: { /* ping */ | 176 | case RNDIS_MSG_KEEPALIVE: { /* ping */ |
169 | struct rndis_keepalive_c *msg = (void *)buf; | 177 | struct rndis_keepalive_c *msg = (void *)buf; |