staging: r8188eu: change last argument type of the usb_write_port function
authorIvan Safonov <insafonov@gmail.com>
Sun, 18 Sep 2016 17:23:42 +0000 (00:23 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2016 11:33:48 +0000 (13:33 +0200)
usb_write_port writes only xmit_buf object data to device.
In addition, an appropriate name for this argument is used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
drivers/staging/rtl8188eu/include/usb_ops_linux.h
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c

index 3e6f5ca5e5c22fbb65600582313545d3f3d3a3db..5482f479907c1798abdd28ce1ec7a6bb97e4eb79 100644 (file)
@@ -387,7 +387,7 @@ static s32 rtw_dump_xframe(struct adapter *adapt, struct xmit_frame *pxmitframe)
                }
                ff_hwaddr = rtw_get_ff_hwaddr(pxmitframe);
 
-               inner_ret = usb_write_port(adapt, ff_hwaddr, w_sz, (unsigned char *)pxmitbuf);
+               inner_ret = usb_write_port(adapt, ff_hwaddr, w_sz, pxmitbuf);
 
                rtw_count_tx_stats(adapt, pxmitframe, sz);
 
@@ -592,7 +592,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
 
        /* 3 4. write xmit buffer to USB FIFO */
        ff_hwaddr = rtw_get_ff_hwaddr(pfirstframe);
-       usb_write_port(adapt, ff_hwaddr, pbuf_tail, (u8 *)pxmitbuf);
+       usb_write_port(adapt, ff_hwaddr, pbuf_tail, pxmitbuf);
 
        /* 3 5. update statisitc */
        pbuf_tail -= (pfirstframe->agg_num * TXDESC_SIZE);
index 220733314f8bfc630d43a99aa5eed0b411871658..fde7753916ee0cd8ccce5e7a883b4fdaeec1bd9b 100644 (file)
@@ -75,7 +75,7 @@ int usb_write8(struct adapter *adapter, u32 addr, u8 val);
 int usb_write16(struct adapter *adapter, u32 addr, u16 val);
 int usb_write32(struct adapter *adapter, u32 addr, u32 val);
 
-u32 usb_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
+u32 usb_write_port(struct adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *pmem);
 void usb_write_port_cancel(struct adapter *adapter);
 
 #endif
index 9359cc7c7a493b792ca4000444bef3042531feee..52fa65980661f13712e7a238ad7f4cf948919a36 100644 (file)
@@ -693,7 +693,7 @@ check_completion:
        tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
 }
 
-u32 usb_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
+u32 usb_write_port(struct adapter *padapter, u32 addr, u32 cnt, struct xmit_buf *xmitbuf)
 {
        unsigned long irqL;
        unsigned int pipe;
@@ -702,8 +702,7 @@ u32 usb_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
        struct urb *purb = NULL;
        struct dvobj_priv       *pdvobj = adapter_to_dvobj(padapter);
        struct xmit_priv        *pxmitpriv = &padapter->xmitpriv;
-       struct xmit_buf *pxmitbuf = (struct xmit_buf *)wmem;
-       struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data;
+       struct xmit_frame *pxmitframe = (struct xmit_frame *)xmitbuf->priv_data;
        struct usb_device *pusbd = pdvobj->pusbdev;
 
 
@@ -713,7 +712,7 @@ u32 usb_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
            (padapter->pwrctrlpriv.pnp_bstop_trx)) {
                RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
                         ("usb_write_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n"));
-               rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_TX_DENY);
+               rtw_sctx_done_err(&xmitbuf->sctx, RTW_SCTX_DONE_TX_DENY);
                goto exit;
        }
 
@@ -722,44 +721,44 @@ u32 usb_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
        switch (addr) {
        case VO_QUEUE_INX:
                pxmitpriv->voq_cnt++;
-               pxmitbuf->flags = VO_QUEUE_INX;
+               xmitbuf->flags = VO_QUEUE_INX;
                break;
        case VI_QUEUE_INX:
                pxmitpriv->viq_cnt++;
-               pxmitbuf->flags = VI_QUEUE_INX;
+               xmitbuf->flags = VI_QUEUE_INX;
                break;
        case BE_QUEUE_INX:
                pxmitpriv->beq_cnt++;
-               pxmitbuf->flags = BE_QUEUE_INX;
+               xmitbuf->flags = BE_QUEUE_INX;
                break;
        case BK_QUEUE_INX:
                pxmitpriv->bkq_cnt++;
-               pxmitbuf->flags = BK_QUEUE_INX;
+               xmitbuf->flags = BK_QUEUE_INX;
                break;
        case HIGH_QUEUE_INX:
-               pxmitbuf->flags = HIGH_QUEUE_INX;
+               xmitbuf->flags = HIGH_QUEUE_INX;
                break;
        default:
-               pxmitbuf->flags = MGT_QUEUE_INX;
+               xmitbuf->flags = MGT_QUEUE_INX;
                break;
        }
 
        spin_unlock_irqrestore(&pxmitpriv->lock, irqL);
 
-       purb    = pxmitbuf->pxmit_urb[0];
+       purb    = xmitbuf->pxmit_urb[0];
 
        /* translate DMA FIFO addr to pipehandle */
        pipe = ffaddr2pipehdl(pdvobj, addr);
 
        usb_fill_bulk_urb(purb, pusbd, pipe,
-                         pxmitframe->buf_addr, /*  pxmitbuf->pbuf */
+                         pxmitframe->buf_addr, /*  xmitbuf->pbuf */
                          cnt,
                          usb_write_port_complete,
-                         pxmitbuf);/* context is pxmitbuf */
+                         xmitbuf);/* context is xmitbuf */
 
        status = usb_submit_urb(purb, GFP_ATOMIC);
        if (status) {
-               rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_WRITE_PORT_ERR);
+               rtw_sctx_done_err(&xmitbuf->sctx, RTW_SCTX_DONE_WRITE_PORT_ERR);
                DBG_88E("usb_write_port, status =%d\n", status);
                RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_write_port(): usb_submit_urb, status =%x\n", status));
 
@@ -781,7 +780,7 @@ u32 usb_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
 
 exit:
        if (ret != _SUCCESS)
-               rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
+               rtw_free_xmitbuf(pxmitpriv, xmitbuf);
        return ret;
 }