diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2008-01-25 17:51:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-31 22:26:59 -0500 |
commit | 5d6ecf6c5d4994198527496fa51ea119030400e0 (patch) | |
tree | 3ac03e596e64e24d70b794f77656f352b69b36f6 /drivers/net/usb/rndis_host.c | |
parent | 7c39e038fc738012ba36ed222bb62545ee59c012 (diff) |
rndis_host: Add link_change function pointer to 'struct rndis_data'.
Callback to signal link state changes from minidriver to
'subminidrivers'.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/rndis_host.c')
-rw-r--r-- | drivers/net/usb/rndis_host.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 08139030954f..800c9d02c3f4 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -148,10 +148,26 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf) | |||
148 | request_id, xid); | 148 | request_id, xid); |
149 | /* then likely retry */ | 149 | /* then likely retry */ |
150 | } else switch (buf->msg_type) { | 150 | } else switch (buf->msg_type) { |
151 | case RNDIS_MSG_INDICATE: { /* fault */ | 151 | case RNDIS_MSG_INDICATE: { /* fault/event */ |
152 | // struct rndis_indicate *msg = (void *)buf; | 152 | struct rndis_indicate *msg = (void *)buf; |
153 | dev_info(&info->control->dev, | 153 | int state = 0; |
154 | "rndis fault indication\n"); | 154 | |
155 | switch (msg->status) { | ||
156 | case RNDIS_STATUS_MEDIA_CONNECT: | ||
157 | state = 1; | ||
158 | case RNDIS_STATUS_MEDIA_DISCONNECT: | ||
159 | dev_info(&info->control->dev, | ||
160 | "rndis media %sconnect\n", | ||
161 | !state?"dis":""); | ||
162 | if (dev->driver_info->link_change) | ||
163 | dev->driver_info->link_change( | ||
164 | dev, state); | ||
165 | break; | ||
166 | default: | ||
167 | dev_info(&info->control->dev, | ||
168 | "rndis indication: 0x%08x\n", | ||
169 | le32_to_cpu(msg->status)); | ||
170 | } | ||
155 | } | 171 | } |
156 | break; | 172 | break; |
157 | case RNDIS_MSG_KEEPALIVE: { /* ping */ | 173 | case RNDIS_MSG_KEEPALIVE: { /* ping */ |