staging: ft1000: Fix coding style in ft1000_copy_down_pkt function.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
251c72f84a
commit
d8dfaf4c94
@@ -929,37 +929,31 @@ static void ft1000_usb_transmit_complete(struct urb *urb)
|
|||||||
// SUCCESS
|
// SUCCESS
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
|
static int ft1000_copy_down_pkt(struct net_device *netdev, u8 * packet, u16 len)
|
||||||
{
|
{
|
||||||
struct ft1000_info *pInfo = netdev_priv(netdev);
|
struct ft1000_info *pInfo = netdev_priv(netdev);
|
||||||
struct ft1000_device *pFt1000Dev = pInfo->pFt1000Dev;
|
struct ft1000_device *pFt1000Dev = pInfo->pFt1000Dev;
|
||||||
|
|
||||||
|
|
||||||
int count, ret;
|
int count, ret;
|
||||||
u8 *t;
|
u8 *t;
|
||||||
struct pseudo_hdr hdr;
|
struct pseudo_hdr hdr;
|
||||||
|
|
||||||
if (!pInfo->CardReady)
|
if (!pInfo->CardReady) {
|
||||||
{
|
|
||||||
|
|
||||||
DEBUG("ft1000_copy_down_pkt::Card Not Ready\n");
|
DEBUG("ft1000_copy_down_pkt::Card Not Ready\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//DEBUG("ft1000_copy_down_pkt() entered, len = %d\n", len);
|
//DEBUG("ft1000_copy_down_pkt() entered, len = %d\n", len);
|
||||||
|
|
||||||
count = sizeof(struct pseudo_hdr) + len;
|
count = sizeof(struct pseudo_hdr) + len;
|
||||||
if(count > MAX_BUF_SIZE)
|
if (count > MAX_BUF_SIZE) {
|
||||||
{
|
|
||||||
DEBUG("Error:ft1000_copy_down_pkt:Message Size Overflow!\n");
|
DEBUG("Error:ft1000_copy_down_pkt:Message Size Overflow!\n");
|
||||||
DEBUG("size = %d\n", count);
|
DEBUG("size = %d\n", count);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( count % 4)
|
if (count % 4)
|
||||||
count = count + (4- (count %4) );
|
count = count + (4 - (count % 4));
|
||||||
|
|
||||||
memset(&hdr, 0, sizeof(struct pseudo_hdr));
|
memset(&hdr, 0, sizeof(struct pseudo_hdr));
|
||||||
|
|
||||||
@@ -972,8 +966,7 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
|
|||||||
hdr.control = 0x00;
|
hdr.control = 0x00;
|
||||||
|
|
||||||
hdr.checksum = hdr.length ^ hdr.source ^ hdr.destination ^
|
hdr.checksum = hdr.length ^ hdr.source ^ hdr.destination ^
|
||||||
hdr.portdest ^ hdr.portsrc ^ hdr.sh_str_id ^
|
hdr.portdest ^ hdr.portsrc ^ hdr.sh_str_id ^ hdr.control;
|
||||||
hdr.control;
|
|
||||||
|
|
||||||
memcpy(&pFt1000Dev->tx_buf[0], &hdr, sizeof(hdr));
|
memcpy(&pFt1000Dev->tx_buf[0], &hdr, sizeof(hdr));
|
||||||
memcpy(&(pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)]), packet, len);
|
memcpy(&(pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)]), packet, len);
|
||||||
@@ -984,27 +977,26 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
|
|||||||
|
|
||||||
usb_fill_bulk_urb(pFt1000Dev->tx_urb,
|
usb_fill_bulk_urb(pFt1000Dev->tx_urb,
|
||||||
pFt1000Dev->dev,
|
pFt1000Dev->dev,
|
||||||
usb_sndbulkpipe(pFt1000Dev->dev, pFt1000Dev->bulk_out_endpointAddr),
|
usb_sndbulkpipe(pFt1000Dev->dev,
|
||||||
pFt1000Dev->tx_buf,
|
pFt1000Dev->bulk_out_endpointAddr),
|
||||||
count,
|
pFt1000Dev->tx_buf, count,
|
||||||
ft1000_usb_transmit_complete,
|
ft1000_usb_transmit_complete, (void *)pFt1000Dev);
|
||||||
(void*)pFt1000Dev);
|
|
||||||
|
|
||||||
t = (u8 *)pFt1000Dev->tx_urb->transfer_buffer;
|
t = (u8 *) pFt1000Dev->tx_urb->transfer_buffer;
|
||||||
//DEBUG("transfer_length=%d\n", pFt1000Dev->tx_urb->transfer_buffer_length);
|
//DEBUG("transfer_length=%d\n", pFt1000Dev->tx_urb->transfer_buffer_length);
|
||||||
/*for (i=0; i<count; i++ )
|
/*for (i=0; i<count; i++ )
|
||||||
{
|
{
|
||||||
DEBUG("%x ", *t++ );
|
DEBUG("%x ", *t++ );
|
||||||
}*/
|
} */
|
||||||
|
|
||||||
|
|
||||||
ret = usb_submit_urb(pFt1000Dev->tx_urb, GFP_ATOMIC);
|
ret = usb_submit_urb(pFt1000Dev->tx_urb, GFP_ATOMIC);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
DEBUG("ft1000 failed tx_urb %d\n", ret);
|
DEBUG("ft1000 failed tx_urb %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
pInfo->stats.tx_packets++;
|
pInfo->stats.tx_packets++;
|
||||||
pInfo->stats.tx_bytes += (len+14);
|
pInfo->stats.tx_bytes += (len + 14);
|
||||||
}
|
}
|
||||||
|
|
||||||
//DEBUG("ft1000_copy_down_pkt() exit\n");
|
//DEBUG("ft1000_copy_down_pkt() exit\n");
|
||||||
@@ -1012,6 +1004,7 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Function: ft1000_start_xmit
|
// Function: ft1000_start_xmit
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user