#define usbhsh_port_stat_clear(h, s) ((h)->port_stat &= ~(s))
#define usbhsh_port_stat_get(h) ((h)->port_stat)
-#define usbhsh_pkt_to_req(p) \
+#define usbhsh_pkt_to_ureq(p) \
container_of((void *)p, struct usbhsh_request, pkt)
/*
* req alloc/free
*/
-static void usbhsh_req_list_init(struct usbhsh_hpriv *hpriv)
+static void usbhsh_ureq_list_init(struct usbhsh_hpriv *hpriv)
{
INIT_LIST_HEAD(&hpriv->ureq_link_active);
INIT_LIST_HEAD(&hpriv->ureq_link_free);
}
-static void usbhsh_req_list_quit(struct usbhsh_hpriv *hpriv)
+static void usbhsh_ureq_list_quit(struct usbhsh_hpriv *hpriv)
{
struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv);
struct device *dev = usbhsh_hcd_to_dev(hcd);
kfree(ureq);
}
-static struct usbhsh_request *usbhsh_req_alloc(struct usbhsh_hpriv *hpriv,
+static struct usbhsh_request *usbhsh_ureq_alloc(struct usbhsh_hpriv *hpriv,
struct urb *urb,
gfp_t mem_flags)
{
return ureq;
}
-static void usbhsh_req_free(struct usbhsh_hpriv *hpriv,
+static void usbhsh_ureq_free(struct usbhsh_hpriv *hpriv,
struct usbhsh_request *ureq)
{
struct usbhs_pkt *pkt = &ureq->pkt;
*/
static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
{
- struct usbhsh_request *ureq = usbhsh_pkt_to_req(pkt);
+ struct usbhsh_request *ureq = usbhsh_pkt_to_ureq(pkt);
struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv);
struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv);
struct urb *urb = ureq->urb;
}
urb->actual_length = pkt->actual;
- usbhsh_req_free(hpriv, ureq);
+ usbhsh_ureq_free(hpriv, ureq);
usbhsh_urb_to_ureq(urb) = NULL;
usb_hcd_unlink_urb_from_ep(hcd, urb);
*/
static int usbhsh_is_request_address(struct urb *urb)
{
- struct usb_ctrlrequest *cmd;
+ struct usb_ctrlrequest *req;
- cmd = (struct usb_ctrlrequest *)urb->setup_packet;
+ req = (struct usb_ctrlrequest *)urb->setup_packet;
- if ((DeviceOutRequest == cmd->bRequestType << 8) &&
- (USB_REQ_SET_ADDRESS == cmd->bRequest))
+ if ((DeviceOutRequest == req->bRequestType << 8) &&
+ (USB_REQ_SET_ADDRESS == req->bRequest))
return 1;
else
return 0;
static void usbhsh_data_stage_packet_done(struct usbhs_priv *priv,
struct usbhs_pkt *pkt)
{
- struct usbhsh_request *ureq = usbhsh_pkt_to_req(pkt);
+ struct usbhsh_request *ureq = usbhsh_pkt_to_ureq(pkt);
struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv);
struct urb *urb = ureq->urb;
/* this ureq was connected to urb when usbhsh_urb_enqueue() */
- usbhsh_req_free(hpriv, ureq);
+ usbhsh_ureq_free(hpriv, ureq);
usbhsh_urb_to_ureq(urb) = NULL;
}
* status stage uses allocated ureq.
* it will be freed on usbhsh_queue_done()
*/
- ureq = usbhsh_req_alloc(hpriv, urb, GFP_KERNEL);
+ ureq = usbhsh_ureq_alloc(hpriv, urb, GFP_KERNEL);
pkt = &ureq->pkt;
if (usb_pipein(urb->pipe))
/*
* alloc new request
*/
- ureq = usbhsh_req_alloc(hpriv, urb, mem_flags);
+ ureq = usbhsh_ureq_alloc(hpriv, urb, mem_flags);
if (unlikely(!ureq)) {
ret = -ENOMEM;
goto usbhsh_urb_enqueue_error_free_endpoint;
struct usbhsh_request *ureq = usbhsh_urb_to_ureq(urb);
if (ureq) {
- usbhsh_req_free(hpriv, ureq);
+ usbhsh_ureq_free(hpriv, ureq);
usbhsh_urb_to_ureq(urb) = NULL;
}
hpriv->mod.stop = usbhsh_stop;
hpriv->pipe_info = pipe_info;
hpriv->pipe_size = pipe_size;
- usbhsh_req_list_init(hpriv);
+ usbhsh_ureq_list_init(hpriv);
usbhsh_port_stat_init(hpriv);
/* init all device */
struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv);
struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv);
- usbhsh_req_list_quit(hpriv);
+ usbhsh_ureq_list_quit(hpriv);
usb_put_hcd(hcd);