[PATCH 1/1] ath_hif_usb: Replaced references to 'struct UsbTxQ' to 'struct sk_buff *'
Ramesh R
rshlinux at gmail.com
Thu Nov 12 07:07:00 UTC 2009
From: Ramesh R <rshlinux at gmail.com>
Signed-off-by: Ramesh R <rshlinux at gmail.com>
---
ath/ath9k/ath_hif_usb.c | 53 ++++++++++++++++++++++------------------------
1 files changed, 25 insertions(+), 28 deletions(-)
diff --git a/ath/ath9k/ath_hif_usb.c b/ath/ath9k/ath_hif_usb.c
index 0a67763..a9079c4 100644
--- a/ath/ath9k/ath_hif_usb.c
+++ b/ath/ath9k/ath_hif_usb.c
@@ -91,37 +91,33 @@ struct cmd_urb_context {
struct hif_device_usb *hif_dev;
};
-struct UsbTxQ {
- struct sk_buff *buf;
-};
-
-typedef struct _UsbTxUrbContext {
+struct UsbTxUrbContext {
u8 index;
u8 inUse;
struct hif_device_usb *hif_dev;
struct sk_buff *buf;
struct urb *urb;
-} UsbTxUrbContext;
+};
struct hif_usb_tx_pipe {
u8 usb_pipe;
- struct UsbTxQ UsbTxBufQ[ZM_MAX_TX_BUF_NUM];
+ struct sk_buff *UsbTxBufQ[ZM_MAX_TX_BUF_NUM];
u16 TxBufHead;
u16 TxBufTail;
u16 TxBufCnt;
u16 TxUrbHead;
u16 TxUrbTail;
u16 TxUrbCnt;
- UsbTxUrbContext TxUrbCtx[ZM_MAX_TX_URB_NUM];
+ struct UsbTxUrbContext TxUrbCtx[ZM_MAX_TX_URB_NUM];
usb_complete_t complete;
};
-typedef struct _UsbRxUrbContext {
+struct UsbRxUrbContext {
u8 inUse;
struct hif_device_usb *hif_dev;
struct sk_buff *skb;
struct urb *urb;
-} UsbRxUrbContext;
+};
struct hif_device_usb {
void *htc_handle;
@@ -132,7 +128,7 @@ struct hif_device_usb {
u16 device_id;
struct sk_buff *regUsbReadBuf;
- UsbRxUrbContext RxUrbCtx[ZM_MAX_RX_URB_NUM];
+ struct UsbRxUrbContext RxUrbCtx[ZM_MAX_RX_URB_NUM];
struct usb_anchor rx_submitted;
struct hif_usb_tx_pipe tx_lp;
struct hif_usb_tx_pipe tx_mp;
@@ -262,12 +258,12 @@ out:
return r;
}
-static UsbTxUrbContext *zfLnxGetFreeTxUrb(struct hif_device_usb *hif_dev,
+static struct UsbTxUrbContext *zfLnxGetFreeTxUrb(struct hif_device_usb *hif_dev,
struct hif_usb_tx_pipe *pipe)
{
u16 idx;
unsigned long irqFlag;
- UsbTxUrbContext *ctx = NULL;
+ struct UsbTxUrbContext *ctx = NULL;
spin_lock_irqsave(&(hif_dev->cs_lock), irqFlag);
@@ -285,7 +281,7 @@ static UsbTxUrbContext *zfLnxGetFreeTxUrb(struct hif_device_usb *hif_dev,
}
static void zfLnxPutTxUrb(struct hif_device_usb *hif_dev,
- struct hif_usb_tx_pipe *pipe, UsbTxUrbContext * ctx)
+ struct hif_usb_tx_pipe *pipe, struct UsbTxUrbContext * ctx)
{
unsigned long irqFlag;
@@ -307,11 +303,11 @@ static u16 zfLnxCheckTxBufferCnt(struct hif_device_usb *hif_dev,
return TxBufCnt;
}
-static struct UsbTxQ *zfLnxGetUsbTxBuffer(struct hif_device_usb *hif_dev,
+static struct sk_buff *zfLnxGetUsbTxBuffer(struct hif_device_usb *hif_dev,
struct hif_usb_tx_pipe *pipe)
{
u16 idx;
- struct UsbTxQ *TxQ;
+ struct sk_buff *TxQ;
unsigned long flags;
spin_lock_irqsave(&hif_dev->cs_lock, flags);
@@ -319,7 +315,7 @@ static struct UsbTxQ *zfLnxGetUsbTxBuffer(struct hif_device_usb *hif_dev,
idx = ((pipe->TxBufHead + 1) & (ZM_MAX_TX_BUF_NUM - 1));
if (pipe->TxBufCnt > 0) {
- TxQ = (struct UsbTxQ *) &(pipe->UsbTxBufQ[pipe->TxBufHead]);
+ TxQ = (pipe->UsbTxBufQ[pipe->TxBufHead]);
pipe->TxBufHead =
((pipe->TxBufHead + 1) & (ZM_MAX_TX_BUF_NUM - 1));
pipe->TxBufCnt--;
@@ -341,8 +337,8 @@ static struct UsbTxQ *zfLnxGetUsbTxBuffer(struct hif_device_usb *hif_dev,
static u32 zfLnxUsbSubmitTxData(struct hif_device_usb *hif_dev,
struct hif_usb_tx_pipe *tx_pipe)
{
- UsbTxUrbContext *urb_ctx;
- struct UsbTxQ *tx_data;
+ struct UsbTxUrbContext *urb_ctx;
+ struct sk_buff *tx_data;
struct sk_buff *skb;
int r;
@@ -361,7 +357,7 @@ static u32 zfLnxUsbSubmitTxData(struct hif_device_usb *hif_dev,
return -ENOBUFS;
}
- skb = tx_data->buf;
+ skb = tx_data;
urb_ctx->buf = skb;
/* Submit a tx urb */
@@ -386,7 +382,7 @@ static u32 zfLnxUsbSubmitTxData(struct hif_device_usb *hif_dev,
static void hif_tx_lp_cb(struct urb *urb)
{
- UsbTxUrbContext *ctx = (UsbTxUrbContext *) urb->context;
+ struct UsbTxUrbContext *ctx = (struct UsbTxUrbContext *) urb->context;
struct hif_device_usb *hif_dev = (struct hif_device_usb *)ctx->hif_dev;
struct sk_buff *buf;
@@ -616,7 +612,8 @@ static void hif_cmd_cb(struct urb *urb)
HTCTxCompletionHandler(hif_dev->htc_handle, buf);
}
-static u32 zfLnxUsbIn(struct hif_device_usb *hif_dev, UsbRxUrbContext *RxUrbCtx)
+static u32 zfLnxUsbIn(struct hif_device_usb *hif_dev,
+ struct UsbRxUrbContext *RxUrbCtx)
{
struct urb *urb = RxUrbCtx->urb;
struct sk_buff *skb = RxUrbCtx->skb;
@@ -633,7 +630,8 @@ static u32 zfLnxUsbIn(struct hif_device_usb *hif_dev, UsbRxUrbContext *RxUrbCtx)
static void hif_rx_cb(struct urb *urb)
{
- UsbRxUrbContext *RxUrbCtx = (UsbRxUrbContext *) urb->context;
+ struct UsbRxUrbContext *RxUrbCtx =
+ (struct UsbRxUrbContext *) urb->context;
struct hif_device_usb *hif_dev = RxUrbCtx->hif_dev;
struct sk_buff *buf;
struct sk_buff *new_buf;
@@ -683,7 +681,7 @@ static void hif_rx_cb(struct urb *urb)
static void hif_tx_hp_cb(struct urb *urb)
{
- UsbTxUrbContext *ctx = (UsbTxUrbContext *) urb->context;
+ struct UsbTxUrbContext *ctx = (struct UsbTxUrbContext *) urb->context;
struct hif_device_usb *hif_dev = (struct hif_device_usb *)ctx->hif_dev;
struct sk_buff *buf;
@@ -706,7 +704,7 @@ static void hif_tx_hp_cb(struct urb *urb)
static void hif_tx_mp_cb(struct urb *urb)
{
- UsbTxUrbContext *ctx = (UsbTxUrbContext *) urb->context;
+ struct UsbTxUrbContext *ctx = (struct UsbTxUrbContext *) urb->context;
struct hif_device_usb *hif_dev = (struct hif_device_usb *)ctx->hif_dev;
struct sk_buff *buf;
@@ -732,7 +730,7 @@ static u16 zfLnxPutUsbTxBuffer(struct hif_device_usb *hif_dev, struct sk_buff *b
{
unsigned long flags;
u16 idx;
- struct UsbTxQ *TxQ;
+ struct sk_buff *TxQ;
int r = 0;
spin_lock_irqsave(&(hif_dev->cs_lock), flags);
@@ -744,8 +742,7 @@ static u16 zfLnxPutUsbTxBuffer(struct hif_device_usb *hif_dev, struct sk_buff *b
goto out;
}
- TxQ = (struct UsbTxQ *) &(tx_pipe->UsbTxBufQ[tx_pipe->TxBufTail]);
- TxQ->buf = buf;
+ TxQ = (tx_pipe->UsbTxBufQ[tx_pipe->TxBufTail]);
tx_pipe->TxBufTail = ((tx_pipe->TxBufTail + 1) &
(ZM_MAX_TX_BUF_NUM - 1));
tx_pipe->TxBufCnt++;
--
1.5.6.5
More information about the devel
mailing list