|
@@ -47,6 +47,8 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
|
|
|
(requesttype == USB_VENDOR_REQUEST_IN) ?
|
|
|
usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0);
|
|
|
|
|
|
+ if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
|
|
|
+ return -ENODEV;
|
|
|
|
|
|
for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
|
|
status = usb_control_msg(usb_dev, pipe, request, requesttype,
|
|
@@ -60,8 +62,10 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
|
|
|
* -ENODEV: Device has disappeared, no point continuing.
|
|
|
* All other errors: Try again.
|
|
|
*/
|
|
|
- else if (status == -ENODEV)
|
|
|
+ else if (status == -ENODEV) {
|
|
|
+ clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
ERROR(rt2x00dev,
|
|
@@ -161,6 +165,9 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev,
|
|
|
{
|
|
|
unsigned int i;
|
|
|
|
|
|
+ if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
|
|
|
+ return -ENODEV;
|
|
|
+
|
|
|
for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
|
|
rt2x00usb_register_read_lock(rt2x00dev, offset, reg);
|
|
|
if (!rt2x00_get_field32(*reg, field))
|