diff options
-rw-r--r-- | drivers/net/usb/rndis_host.c | 24 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.h | 4 |
2 files changed, 24 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 */ |
diff --git a/drivers/net/usb/usbnet.h b/drivers/net/usb/usbnet.h index 25b63d3339dc..e0501da3dd11 100644 --- a/drivers/net/usb/usbnet.h +++ b/drivers/net/usb/usbnet.h | |||
@@ -121,6 +121,10 @@ struct driver_info { | |||
121 | * right after minidriver have initialized hardware. */ | 121 | * right after minidriver have initialized hardware. */ |
122 | int (*early_init)(struct usbnet *dev); | 122 | int (*early_init)(struct usbnet *dev); |
123 | 123 | ||
124 | /* called by minidriver when link state changes, state: 0=disconnect, | ||
125 | * 1=connect */ | ||
126 | void (*link_change)(struct usbnet *dev, int state); | ||
127 | |||
124 | /* for new devices, use the descriptor-reading code instead */ | 128 | /* for new devices, use the descriptor-reading code instead */ |
125 | int in; /* rx endpoint */ | 129 | int in; /* rx endpoint */ |
126 | int out; /* tx endpoint */ | 130 | int out; /* tx endpoint */ |