Commit 22976bc3 authored by Kevin McKinney's avatar Kevin McKinney Committed by Greg Kroah-Hartman

Staging: bcm: Fix all white space issues in Transmit.c

This patch fixes all white space issues
as reported by checkpatch.pl.
Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5d6f5054
...@@ -35,7 +35,6 @@ SendPacketFromQueue->SetupNextSend->bcm_cmd53 ...@@ -35,7 +35,6 @@ SendPacketFromQueue->SetupNextSend->bcm_cmd53
#include "headers.h" #include "headers.h"
/** /**
@ingroup ctrl_pkt_functions @ingroup ctrl_pkt_functions
This function dispatches control packet to the h/w interface This function dispatches control packet to the h/w interface
...@@ -45,36 +44,36 @@ INT SendControlPacket(struct bcm_mini_adapter *Adapter, char *pControlPacket) ...@@ -45,36 +44,36 @@ INT SendControlPacket(struct bcm_mini_adapter *Adapter, char *pControlPacket)
{ {
struct bcm_leader *PLeader = (struct bcm_leader *)pControlPacket; struct bcm_leader *PLeader = (struct bcm_leader *)pControlPacket;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Tx"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Tx");
if(!pControlPacket || !Adapter) if (!pControlPacket || !Adapter)
{
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Got NULL Control Packet or Adapter");
return STATUS_FAILURE;
}
if ((atomic_read(&Adapter->CurrNumFreeTxDesc) <
((PLeader->PLength-1)/MAX_DEVICE_DESC_SIZE)+1))
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Got NULL Control Packet or Adapter"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "NO FREE DESCRIPTORS TO SEND CONTROL PACKET");
return STATUS_FAILURE; return STATUS_FAILURE;
} }
if((atomic_read( &Adapter->CurrNumFreeTxDesc ) <
((PLeader->PLength-1)/MAX_DEVICE_DESC_SIZE)+1))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "NO FREE DESCRIPTORS TO SEND CONTROL PACKET");
return STATUS_FAILURE;
}
/* Update the netdevice statistics */ /* Update the netdevice statistics */
/* Dump Packet */ /* Dump Packet */
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader Status: %x", PLeader->Status); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader Status: %x", PLeader->Status);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader VCID: %x",PLeader->Vcid); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader VCID: %x", PLeader->Vcid);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader Length: %x",PLeader->PLength); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader Length: %x", PLeader->PLength);
if(Adapter->device_removed) if (Adapter->device_removed)
return 0; return 0;
if (netif_msg_pktdata(Adapter)) if (netif_msg_pktdata(Adapter))
print_hex_dump(KERN_DEBUG, PFX "tx control: ", DUMP_PREFIX_NONE, print_hex_dump(KERN_DEBUG, PFX "tx control: ", DUMP_PREFIX_NONE,
16, 1, pControlPacket, PLeader->PLength + LEADER_SIZE, 0); 16, 1, pControlPacket, PLeader->PLength + LEADER_SIZE, 0);
Adapter->interface_transmit(Adapter->pvInterfaceAdapter, Adapter->interface_transmit(Adapter->pvInterfaceAdapter,
pControlPacket, (PLeader->PLength + LEADER_SIZE)); pControlPacket, (PLeader->PLength + LEADER_SIZE));
atomic_dec(&Adapter->CurrNumFreeTxDesc); atomic_dec(&Adapter->CurrNumFreeTxDesc);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "<========="); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "<=========");
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
...@@ -86,54 +85,54 @@ to the target via the host h/w interface. ...@@ -86,54 +85,54 @@ to the target via the host h/w interface.
*/ */
INT SetupNextSend(struct bcm_mini_adapter *Adapter, struct sk_buff *Packet, USHORT Vcid) INT SetupNextSend(struct bcm_mini_adapter *Adapter, struct sk_buff *Packet, USHORT Vcid)
{ {
int status=0; int status = 0;
BOOLEAN bHeaderSupressionEnabled = FALSE; BOOLEAN bHeaderSupressionEnabled = FALSE;
B_UINT16 uiClassifierRuleID; B_UINT16 uiClassifierRuleID;
u16 QueueIndex = skb_get_queue_mapping(Packet); u16 QueueIndex = skb_get_queue_mapping(Packet);
struct bcm_leader Leader={0}; struct bcm_leader Leader = {0};
if(Packet->len > MAX_DEVICE_DESC_SIZE) if (Packet->len > MAX_DEVICE_DESC_SIZE)
{ {
status = STATUS_FAILURE; status = STATUS_FAILURE;
goto errExit; goto errExit;
} }
/* Get the Classifier Rule ID */ /* Get the Classifier Rule ID */
uiClassifierRuleID = *((UINT32*) (Packet->cb)+SKB_CB_CLASSIFICATION_OFFSET); uiClassifierRuleID = *((UINT32 *) (Packet->cb) + SKB_CB_CLASSIFICATION_OFFSET);
bHeaderSupressionEnabled = Adapter->PackInfo[QueueIndex].bHeaderSuppressionEnabled bHeaderSupressionEnabled = Adapter->PackInfo[QueueIndex].bHeaderSuppressionEnabled
& Adapter->bPHSEnabled; & Adapter->bPHSEnabled;
if(Adapter->device_removed) if (Adapter->device_removed)
{ {
status = STATUS_FAILURE; status = STATUS_FAILURE;
goto errExit; goto errExit;
} }
status = PHSTransmit(Adapter, &Packet, Vcid, uiClassifierRuleID, bHeaderSupressionEnabled, status = PHSTransmit(Adapter, &Packet, Vcid, uiClassifierRuleID, bHeaderSupressionEnabled,
(UINT *)&Packet->len, Adapter->PackInfo[QueueIndex].bEthCSSupport); (UINT *)&Packet->len, Adapter->PackInfo[QueueIndex].bEthCSSupport);
if(status != STATUS_SUCCESS) if (status != STATUS_SUCCESS)
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL, "PHS Transmit failed..\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL, "PHS Transmit failed..\n");
goto errExit; goto errExit;
} }
Leader.Vcid = Vcid; Leader.Vcid = Vcid;
if(TCP_ACK == *((UINT32*) (Packet->cb) + SKB_CB_TCPACK_OFFSET )) if (TCP_ACK == *((UINT32 *) (Packet->cb) + SKB_CB_TCPACK_OFFSET))
Leader.Status = LEADER_STATUS_TCP_ACK; Leader.Status = LEADER_STATUS_TCP_ACK;
else else
Leader.Status = LEADER_STATUS; Leader.Status = LEADER_STATUS;
if(Adapter->PackInfo[QueueIndex].bEthCSSupport) if (Adapter->PackInfo[QueueIndex].bEthCSSupport)
{ {
Leader.PLength = Packet->len; Leader.PLength = Packet->len;
if(skb_headroom(Packet) < LEADER_SIZE) if (skb_headroom(Packet) < LEADER_SIZE)
{ {
if((status = skb_cow(Packet,LEADER_SIZE))) if ((status = skb_cow(Packet, LEADER_SIZE)))
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"bcm_transmit : Failed To Increase headRoom\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL, "bcm_transmit : Failed To Increase headRoom\n");
goto errExit; goto errExit;
} }
} }
...@@ -147,8 +146,8 @@ INT SetupNextSend(struct bcm_mini_adapter *Adapter, struct sk_buff *Packet, USH ...@@ -147,8 +146,8 @@ INT SetupNextSend(struct bcm_mini_adapter *Adapter, struct sk_buff *Packet, USH
} }
status = Adapter->interface_transmit(Adapter->pvInterfaceAdapter, status = Adapter->interface_transmit(Adapter->pvInterfaceAdapter,
Packet->data, (Leader.PLength + LEADER_SIZE)); Packet->data, (Leader.PLength + LEADER_SIZE));
if(status) if (status)
{ {
++Adapter->dev->stats.tx_errors; ++Adapter->dev->stats.tx_errors;
if (netif_msg_tx_err(Adapter)) if (netif_msg_tx_err(Adapter))
...@@ -175,7 +174,6 @@ INT SetupNextSend(struct bcm_mini_adapter *Adapter, struct sk_buff *Packet, USH ...@@ -175,7 +174,6 @@ INT SetupNextSend(struct bcm_mini_adapter *Adapter, struct sk_buff *Packet, USH
atomic_dec(&Adapter->CurrNumFreeTxDesc); atomic_dec(&Adapter->CurrNumFreeTxDesc);
errExit: errExit:
dev_kfree_skb(Packet); dev_kfree_skb(Packet);
return status; return status;
} }
...@@ -191,70 +189,68 @@ static int tx_pending(struct bcm_mini_adapter *Adapter) ...@@ -191,70 +189,68 @@ static int tx_pending(struct bcm_mini_adapter *Adapter)
@ingroup tx_functions @ingroup tx_functions
Transmit thread Transmit thread
*/ */
int tx_pkt_handler(struct bcm_mini_adapter *Adapter /**< pointer to adapter object*/ int tx_pkt_handler(struct bcm_mini_adapter *Adapter /**< pointer to adapter object*/)
)
{ {
int status = 0; int status = 0;
while(! kthread_should_stop()) { while (!kthread_should_stop()) {
/* FIXME - the timeout looks like workaround for racey usage of TxPktAvail */ /* FIXME - the timeout looks like workaround for racey usage of TxPktAvail */
if(Adapter->LinkUpStatus) if (Adapter->LinkUpStatus)
wait_event_timeout(Adapter->tx_packet_wait_queue, wait_event_timeout(Adapter->tx_packet_wait_queue,
tx_pending(Adapter), msecs_to_jiffies(10)); tx_pending(Adapter), msecs_to_jiffies(10));
else else
wait_event_interruptible(Adapter->tx_packet_wait_queue, wait_event_interruptible(Adapter->tx_packet_wait_queue,
tx_pending(Adapter)); tx_pending(Adapter));
if (Adapter->device_removed) if (Adapter->device_removed)
break; break;
if(Adapter->downloadDDR == 1) if (Adapter->downloadDDR == 1)
{ {
Adapter->downloadDDR +=1; Adapter->downloadDDR += 1;
status = download_ddr_settings(Adapter); status = download_ddr_settings(Adapter);
if(status) if (status)
pr_err(PFX "DDR DOWNLOAD FAILED! %d\n", status); pr_err(PFX "DDR DOWNLOAD FAILED! %d\n", status);
continue; continue;
} }
//Check end point for halt/stall. //Check end point for halt/stall.
if(Adapter->bEndPointHalted == TRUE) if (Adapter->bEndPointHalted == TRUE)
{ {
Bcm_clear_halt_of_endpoints(Adapter); Bcm_clear_halt_of_endpoints(Adapter);
Adapter->bEndPointHalted = FALSE; Adapter->bEndPointHalted = FALSE;
StartInterruptUrb((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter)); StartInterruptUrb((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter));
} }
if(Adapter->LinkUpStatus && !Adapter->IdleMode) if (Adapter->LinkUpStatus && !Adapter->IdleMode)
{ {
if(atomic_read(&Adapter->TotalPacketCount)) if (atomic_read(&Adapter->TotalPacketCount))
{ {
update_per_sf_desc_cnts(Adapter); update_per_sf_desc_cnts(Adapter);
} }
} }
if( atomic_read(&Adapter->CurrNumFreeTxDesc) && if (atomic_read(&Adapter->CurrNumFreeTxDesc) &&
Adapter->LinkStatus == SYNC_UP_REQUEST && Adapter->LinkStatus == SYNC_UP_REQUEST &&
!Adapter->bSyncUpRequestSent) !Adapter->bSyncUpRequestSent)
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "Calling LinkMessage"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "Calling LinkMessage");
LinkMessage(Adapter); LinkMessage(Adapter);
} }
if((Adapter->IdleMode || Adapter->bShutStatus) && atomic_read(&Adapter->TotalPacketCount)) if ((Adapter->IdleMode || Adapter->bShutStatus) && atomic_read(&Adapter->TotalPacketCount))
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "Device in Low Power mode...waking up"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "Device in Low Power mode...waking up");
Adapter->usIdleModePattern = ABORT_IDLE_MODE; Adapter->usIdleModePattern = ABORT_IDLE_MODE;
Adapter->bWakeUpDevice = TRUE; Adapter->bWakeUpDevice = TRUE;
wake_up(&Adapter->process_rx_cntrlpkt); wake_up(&Adapter->process_rx_cntrlpkt);
} }
transmit_packets(Adapter); transmit_packets(Adapter);
atomic_set(&Adapter->TxPktAvail, 0); atomic_set(&Adapter->TxPktAvail, 0);
} }
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "Exiting the tx thread..\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "Exiting the tx thread..\n");
Adapter->transmit_packet_thread = NULL; Adapter->transmit_packet_thread = NULL;
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment