device_set_options(pDevice);
spin_lock_init(&pDevice->lock);
+ mutex_init(&pDevice->usb_lock);
+
INIT_DELAYED_WORK(&pDevice->run_command_work, vRunCommand);
INIT_DELAYED_WORK(&pDevice->second_callback_work, BSSvSecondCallBack);
INIT_WORK(&pDevice->read_work_item, RXvWorkItem);
return STATUS_FAILURE;
}
+ mutex_lock(&pDevice->usb_lock);
+
ntStatus = usb_control_msg(
pDevice->usb,
usb_sndctrlpipe(pDevice->usb , 0),
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"usb_sndctrlpipe fail, ntStatus= %d\n", ntStatus);
}
+ mutex_unlock(&pDevice->usb_lock);
+
return ntStatus;
}
if (pDevice->pControlURB->hcpriv)
return STATUS_FAILURE;
+ mutex_lock(&pDevice->usb_lock);
+
MP_SET_FLAG(pDevice, fMP_CONTROL_WRITES);
pDevice->sUsbCtlRequest.bRequestType = 0x40;
"control send request submission failed: %d\n",
ntStatus);
MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES);
+ mutex_unlock(&pDevice->usb_lock);
return STATUS_FAILURE;
}
DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "control send request submission timeout\n");
MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES);
+ mutex_unlock(&pDevice->usb_lock);
return STATUS_FAILURE;
}
}
+ mutex_unlock(&pDevice->usb_lock);
+
return STATUS_SUCCESS;
}
if (pDevice->pControlURB->hcpriv)
return STATUS_FAILURE;
+ mutex_lock(&pDevice->usb_lock);
+
MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
pDevice->sUsbCtlRequest.bRequestType = 0xC0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"control request submission failed: %d\n", ntStatus);
MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS);
+ mutex_unlock(&pDevice->usb_lock);
return STATUS_FAILURE;
}
DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "control rcv request submission timeout\n");
MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS);
+ mutex_unlock(&pDevice->usb_lock);
return STATUS_FAILURE;
}
}
+ mutex_unlock(&pDevice->usb_lock);
+
return ntStatus;
}