summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/rndis_host.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2008-01-26 00:51:34 +0200
committerDavid S. Miller <davem@davemloft.net>2008-01-31 19:26:59 -0800
commit5d6ecf6c5d4994198527496fa51ea119030400e0 (patch)
tree3ac03e596e64e24d70b794f77656f352b69b36f6 /drivers/net/usb/rndis_host.c
parent7c39e038fc738012ba36ed222bb62545ee59c012 (diff)
downloadtalos-obmc-linux-5d6ecf6c5d4994198527496fa51ea119030400e0.tar.gz
talos-obmc-linux-5d6ecf6c5d4994198527496fa51ea119030400e0.zip
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.c24
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)
request_id, xid);
/* then likely retry */
} else switch (buf->msg_type) {
- case RNDIS_MSG_INDICATE: { /* fault */
- // struct rndis_indicate *msg = (void *)buf;
- dev_info(&info->control->dev,
- "rndis fault indication\n");
+ case RNDIS_MSG_INDICATE: { /* fault/event */
+ struct rndis_indicate *msg = (void *)buf;
+ int state = 0;
+
+ switch (msg->status) {
+ case RNDIS_STATUS_MEDIA_CONNECT:
+ state = 1;
+ case RNDIS_STATUS_MEDIA_DISCONNECT:
+ dev_info(&info->control->dev,
+ "rndis media %sconnect\n",
+ !state?"dis":"");
+ if (dev->driver_info->link_change)
+ dev->driver_info->link_change(
+ dev, state);
+ break;
+ default:
+ dev_info(&info->control->dev,
+ "rndis indication: 0x%08x\n",
+ le32_to_cpu(msg->status));
+ }
}
break;
case RNDIS_MSG_KEEPALIVE: { /* ping */
OpenPOWER on IntegriCloud