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

Staging: bcm: Remove typedef for _LEADER and call directly.

This patch removes typedef for _LEADER, changes the
name of the struct from _LEADER to bcm_leader.
In addition, any calls to the following typedefs
"LEADER, *PLEADER" are changed to call
the struct directly.
Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a869993f
...@@ -7,16 +7,15 @@ ...@@ -7,16 +7,15 @@
#define MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES 256 #define MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES 256
#include "Debug.h" #include "Debug.h"
struct _LEADER { struct bcm_leader {
USHORT Vcid; USHORT Vcid;
USHORT PLength; USHORT PLength;
UCHAR Status; UCHAR Status;
UCHAR Unused[3]; UCHAR Unused[3];
} __packed; } __packed;
typedef struct _LEADER LEADER, *PLEADER;
struct bcm_packettosend { struct bcm_packettosend {
LEADER Leader; struct bcm_leader Leader;
UCHAR ucPayload; UCHAR ucPayload;
} __packed; } __packed;
...@@ -27,7 +26,7 @@ struct bcm_control_packet { ...@@ -27,7 +26,7 @@ struct bcm_control_packet {
} __packed; } __packed;
struct bcm_link_request { struct bcm_link_request {
LEADER Leader; struct bcm_leader Leader;
UCHAR szData[4]; UCHAR szData[4];
} __packed; } __packed;
......
...@@ -1663,7 +1663,7 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /* <Pointer to the Adap ...@@ -1663,7 +1663,7 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /* <Pointer to the Adap
stServiceFlowParamSI *psfLocalSet = NULL; stServiceFlowParamSI *psfLocalSet = NULL;
stLocalSFAddIndicationAlt *pstAddIndication = NULL; stLocalSFAddIndicationAlt *pstAddIndication = NULL;
stLocalSFChangeIndicationAlt *pstChangeIndication = NULL; stLocalSFChangeIndicationAlt *pstChangeIndication = NULL;
PLEADER pLeader = NULL; struct bcm_leader *pLeader = NULL;
/* /*
* Otherwise the message contains a target address from where we need to * Otherwise the message contains a target address from where we need to
...@@ -1678,7 +1678,7 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /* <Pointer to the Adap ...@@ -1678,7 +1678,7 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /* <Pointer to the Adap
DumpCmControlPacket(pstAddIndication); DumpCmControlPacket(pstAddIndication);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "====>"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "====>");
pLeader = (PLEADER)Adapter->caDsxReqResp; pLeader = (struct bcm_leader *)Adapter->caDsxReqResp;
pLeader->Status = CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ; pLeader->Status = CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ;
pLeader->Vcid = 0; pLeader->Vcid = 0;
......
...@@ -46,7 +46,7 @@ static void read_bulk_callback(struct urb *urb) ...@@ -46,7 +46,7 @@ static void read_bulk_callback(struct urb *urb)
PUSB_RCB pRcb = (PUSB_RCB)urb->context; PUSB_RCB pRcb = (PUSB_RCB)urb->context;
PS_INTERFACE_ADAPTER psIntfAdapter = pRcb->psIntfAdapter; PS_INTERFACE_ADAPTER psIntfAdapter = pRcb->psIntfAdapter;
PMINI_ADAPTER Adapter = psIntfAdapter->psAdapter; PMINI_ADAPTER Adapter = psIntfAdapter->psAdapter;
PLEADER pLeader = urb->transfer_buffer; struct bcm_leader *pLeader = urb->transfer_buffer;
if (unlikely(netif_msg_rx_status(Adapter))) if (unlikely(netif_msg_rx_status(Adapter)))
pr_info(PFX "%s: rx urb status %d length %d\n", pr_info(PFX "%s: rx urb status %d length %d\n",
...@@ -126,7 +126,7 @@ static void read_bulk_callback(struct urb *urb) ...@@ -126,7 +126,7 @@ static void read_bulk_callback(struct urb *urb)
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_CTRL, DBG_LVL_ALL, "Received control pkt..."); BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_CTRL, DBG_LVL_ALL, "Received control pkt...");
*(PUSHORT)skb->data = pLeader->Status; *(PUSHORT)skb->data = pLeader->Status;
memcpy(skb->data+sizeof(USHORT), urb->transfer_buffer + memcpy(skb->data+sizeof(USHORT), urb->transfer_buffer +
(sizeof(LEADER)), pLeader->PLength); (sizeof(struct bcm_leader)), pLeader->PLength);
skb->len = pLeader->PLength + sizeof(USHORT); skb->len = pLeader->PLength + sizeof(USHORT);
spin_lock(&Adapter->control_queue_lock); spin_lock(&Adapter->control_queue_lock);
...@@ -144,7 +144,7 @@ static void read_bulk_callback(struct urb *urb) ...@@ -144,7 +144,7 @@ static void read_bulk_callback(struct urb *urb)
*/ */
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt..."); BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt...");
skb_reserve(skb, 2 + SKB_RESERVE_PHS_BYTES); skb_reserve(skb, 2 + SKB_RESERVE_PHS_BYTES);
memcpy(skb->data+ETH_HLEN, (PUCHAR)urb->transfer_buffer + sizeof(LEADER), pLeader->PLength); memcpy(skb->data+ETH_HLEN, (PUCHAR)urb->transfer_buffer + sizeof(struct bcm_leader), pLeader->PLength);
skb->dev = Adapter->dev; skb->dev = Adapter->dev;
/* currently skb->len has extra ETH_HLEN bytes in the beginning */ /* currently skb->len has extra ETH_HLEN bytes in the beginning */
......
...@@ -243,10 +243,10 @@ static VOID CheckAndSendPacketFromIndex(PMINI_ADAPTER Adapter, struct bcm_packet ...@@ -243,10 +243,10 @@ static VOID CheckAndSendPacketFromIndex(PMINI_ADAPTER Adapter, struct bcm_packet
{ {
spin_lock_bh(&psSF->SFQueueLock); spin_lock_bh(&psSF->SFQueueLock);
psSF->NumOfPacketsSent++; psSF->NumOfPacketsSent++;
psSF->uiSentBytes+=((PLEADER)pControlPacket)->PLength; psSF->uiSentBytes+=((struct bcm_leader *)pControlPacket)->PLength;
psSF->uiSentPackets++; psSF->uiSentPackets++;
atomic_dec(&Adapter->TotalPacketCount); atomic_dec(&Adapter->TotalPacketCount);
psSF->uiCurrentBytesOnHost -= ((PLEADER)pControlPacket)->PLength; psSF->uiCurrentBytesOnHost -= ((struct bcm_leader *)pControlPacket)->PLength;
psSF->uiCurrentPacketsOnHost--; psSF->uiCurrentPacketsOnHost--;
atomic_inc(&Adapter->index_rd_txcntrlpkt); atomic_inc(&Adapter->index_rd_txcntrlpkt);
spin_unlock_bh(&psSF->SFQueueLock); spin_unlock_bh(&psSF->SFQueueLock);
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
/*Leader related terms */ /*Leader related terms */
#define LEADER_STATUS 0x00 #define LEADER_STATUS 0x00
#define LEADER_STATUS_TCP_ACK 0x1 #define LEADER_STATUS_TCP_ACK 0x1
#define LEADER_SIZE sizeof(LEADER) #define LEADER_SIZE sizeof(struct bcm_leader)
#define MAC_ADDR_REQ_SIZE sizeof(struct bcm_packettosend) #define MAC_ADDR_REQ_SIZE sizeof(struct bcm_packettosend)
#define SS_INFO_REQ_SIZE sizeof(struct bcm_packettosend) #define SS_INFO_REQ_SIZE sizeof(struct bcm_packettosend)
#define CM_REQUEST_SIZE (LEADER_SIZE + sizeof(stLocalSFChangeRequest)) #define CM_REQUEST_SIZE (LEADER_SIZE + sizeof(stLocalSFChangeRequest))
......
...@@ -233,7 +233,7 @@ static int BcmFileDownload(PMINI_ADAPTER Adapter, const char *path, unsigned int ...@@ -233,7 +233,7 @@ static int BcmFileDownload(PMINI_ADAPTER Adapter, const char *path, unsigned int
*/ */
INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter, PVOID ioBuffer) INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter, PVOID ioBuffer)
{ {
PLEADER pLeader = NULL; struct bcm_leader *pLeader = NULL;
INT Status = 0; INT Status = 0;
unsigned char *ctrl_buff = NULL; unsigned char *ctrl_buff = NULL;
UINT pktlen = 0; UINT pktlen = 0;
...@@ -247,7 +247,7 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter, PVOID ioBuffer) ...@@ -247,7 +247,7 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter, PVOID ioBuffer)
} }
pLinkReq = (struct bcm_link_request *)ioBuffer; pLinkReq = (struct bcm_link_request *)ioBuffer;
pLeader = (PLEADER)ioBuffer; /* ioBuffer Contains sw_Status and Payload */ pLeader = (struct bcm_leader *)ioBuffer; /* ioBuffer Contains sw_Status and Payload */
if (Adapter->bShutStatus == TRUE && if (Adapter->bShutStatus == TRUE &&
pLinkReq->szData[0] == LINK_DOWN_REQ_PAYLOAD && pLinkReq->szData[0] == LINK_DOWN_REQ_PAYLOAD &&
...@@ -373,7 +373,7 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter, PVOID ioBuffer) ...@@ -373,7 +373,7 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter, PVOID ioBuffer)
memset(ctrl_buff, 0, pktlen+LEADER_SIZE); memset(ctrl_buff, 0, pktlen+LEADER_SIZE);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Copying the Control Packet Buffer with length=%d\n", pLeader->PLength); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Copying the Control Packet Buffer with length=%d\n", pLeader->PLength);
*(PLEADER)ctrl_buff = *pLeader; *(struct bcm_leader *)ctrl_buff = *pLeader;
memcpy(ctrl_buff + LEADER_SIZE, ((PUCHAR)ioBuffer + LEADER_SIZE), pLeader->PLength); memcpy(ctrl_buff + LEADER_SIZE, ((PUCHAR)ioBuffer + LEADER_SIZE), pLeader->PLength);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Enqueuing the Control Packet"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Enqueuing the Control Packet");
......
...@@ -43,7 +43,7 @@ This function dispatches control packet to the h/w interface ...@@ -43,7 +43,7 @@ This function dispatches control packet to the h/w interface
*/ */
INT SendControlPacket(PMINI_ADAPTER Adapter, char *pControlPacket) INT SendControlPacket(PMINI_ADAPTER Adapter, char *pControlPacket)
{ {
PLEADER PLeader = (PLEADER)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)
...@@ -90,7 +90,7 @@ INT SetupNextSend(PMINI_ADAPTER Adapter, struct sk_buff *Packet, USHORT Vcid) ...@@ -90,7 +90,7 @@ INT SetupNextSend(PMINI_ADAPTER Adapter, struct sk_buff *Packet, USHORT Vcid)
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);
LEADER Leader={0}; struct bcm_leader Leader={0};
if(Packet->len > MAX_DEVICE_DESC_SIZE) if(Packet->len > MAX_DEVICE_DESC_SIZE)
{ {
...@@ -143,7 +143,7 @@ INT SetupNextSend(PMINI_ADAPTER Adapter, struct sk_buff *Packet, USHORT Vcid) ...@@ -143,7 +143,7 @@ INT SetupNextSend(PMINI_ADAPTER Adapter, struct sk_buff *Packet, USHORT Vcid)
else else
{ {
Leader.PLength = Packet->len - ETH_HLEN; Leader.PLength = Packet->len - ETH_HLEN;
memcpy((LEADER*)skb_pull(Packet, (ETH_HLEN - LEADER_SIZE)), &Leader, LEADER_SIZE); memcpy((struct bcm_leader *)skb_pull(Packet, (ETH_HLEN - LEADER_SIZE)), &Leader, LEADER_SIZE);
} }
status = Adapter->interface_transmit(Adapter->pvInterfaceAdapter, status = Adapter->interface_transmit(Adapter->pvInterfaceAdapter,
......
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