Removing camel case.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device_main.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 673ca47..0ed82a64 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -142,8 +142,8 @@ static void device_init_rd1_ring(struct vnt_private *priv);
static void device_init_td0_ring(struct vnt_private *priv);
static void device_init_td1_ring(struct vnt_private *priv);
-static int device_rx_srv(struct vnt_private *priv, unsigned int uIdx);
-static int device_tx_srv(struct vnt_private *priv, unsigned int uIdx);
+static int device_rx_srv(struct vnt_private *priv, unsigned int idx);
+static int device_tx_srv(struct vnt_private *priv, unsigned int idx);
static bool device_alloc_rx_buf(struct vnt_private *, struct vnt_rx_desc *);
static void device_init_registers(struct vnt_private *priv);
static void device_free_tx_buf(struct vnt_private *, struct vnt_tx_desc *);
@@ -700,12 +700,12 @@ static void device_free_td1_ring(struct vnt_private *priv)
/*-----------------------------------------------------------------*/
-static int device_rx_srv(struct vnt_private *priv, unsigned int uIdx)
+static int device_rx_srv(struct vnt_private *priv, unsigned int idx)
{
struct vnt_rx_desc *rd;
int works = 0;
- for (rd = priv->pCurrRD[uIdx];
+ for (rd = priv->pCurrRD[idx];
rd->rd0.owner == OWNED_BY_HOST;
rd = rd->next) {
if (works++ > 15)
@@ -724,7 +724,7 @@ static int device_rx_srv(struct vnt_private *priv, unsigned int uIdx)
rd->rd0.owner = OWNED_BY_NIC;
}
- priv->pCurrRD[uIdx] = rd;
+ priv->pCurrRD[idx] = rd;
return works;
}
@@ -829,14 +829,14 @@ static int vnt_int_report_rate(struct vnt_private *priv,
return 0;
}
-static int device_tx_srv(struct vnt_private *priv, unsigned int uIdx)
+static int device_tx_srv(struct vnt_private *priv, unsigned int idx)
{
struct vnt_tx_desc *desc;
int works = 0;
unsigned char byTsr0;
unsigned char byTsr1;
- for (desc = priv->apTailTD[uIdx]; priv->iTDUsed[uIdx] > 0; desc = desc->next) {
+ for (desc = priv->apTailTD[idx]; priv->iTDUsed[idx] > 0; desc = desc->next) {
if (desc->td0.owner == OWNED_BY_NIC)
break;
if (works++ > 15)
@@ -851,30 +851,30 @@ static int device_tx_srv(struct vnt_private *priv, unsigned int uIdx)
if (!(byTsr1 & TSR1_TERR)) {
if (byTsr0 != 0) {
pr_debug(" Tx[%d] OK but has error. tsr1[%02X] tsr0[%02X]\n",
- (int)uIdx, byTsr1,
+ (int)idx, byTsr1,
byTsr0);
}
} else {
pr_debug(" Tx[%d] dropped & tsr1[%02X] tsr0[%02X]\n",
- (int)uIdx, byTsr1, byTsr0);
+ (int)idx, byTsr1, byTsr0);
}
}
if (byTsr1 & TSR1_TERR) {
if ((desc->td_info->flags & TD_FLAGS_PRIV_SKB) != 0) {
pr_debug(" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X]\n",
- (int)uIdx, byTsr1, byTsr0);
+ (int)idx, byTsr1, byTsr0);
}
}
vnt_int_report_rate(priv, desc->td_info, byTsr0, byTsr1);
device_free_tx_buf(priv, desc);
- priv->iTDUsed[uIdx]--;
+ priv->iTDUsed[idx]--;
}
}
- priv->apTailTD[uIdx] = desc;
+ priv->apTailTD[idx] = desc;
return works;
}
--
2.5.0
bring pointers and members into line.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/card.c | 8 +--
drivers/staging/vt6655/device.h | 4 +-
drivers/staging/vt6655/device_main.c | 108 +++++++++++++++++------------------
3 files changed, 60 insertions(+), 60 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 71c9b97..c45e494 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -523,12 +523,12 @@ CARDvSafeResetTx(
for (uu = 0; uu < TYPE_MAXTD; uu++)
pDevice->iTDUsed[uu] = 0;
- for (uu = 0; uu < pDevice->sOpts.tx_descs[0]; uu++) {
+ for (uu = 0; uu < pDevice->opts.tx_descs[0]; uu++) {
pCurrTD = &(pDevice->apTD0Rings[uu]);
pCurrTD->td0.owner = OWNED_BY_HOST;
/* init all Tx Packet pointer to NULL */
}
- for (uu = 0; uu < pDevice->sOpts.tx_descs[1]; uu++) {
+ for (uu = 0; uu < pDevice->opts.tx_descs[1]; uu++) {
pCurrTD = &(pDevice->apTD1Rings[uu]);
pCurrTD->td0.owner = OWNED_BY_HOST;
/* init all Tx Packet pointer to NULL */
@@ -571,7 +571,7 @@ CARDvSafeResetRx(
pDevice->pCurrRD[1] = &(pDevice->aRD1Ring[0]);
/* init state, all RD is chip's */
- for (uu = 0; uu < pDevice->sOpts.rx_descs0; uu++) {
+ for (uu = 0; uu < pDevice->opts.rx_descs0; uu++) {
pDesc = &(pDevice->aRD0Ring[uu]);
pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
pDesc->rd0.owner = OWNED_BY_NIC;
@@ -579,7 +579,7 @@ CARDvSafeResetRx(
}
/* init state, all RD is chip's */
- for (uu = 0; uu < pDevice->sOpts.rx_descs1; uu++) {
+ for (uu = 0; uu < pDevice->opts.rx_descs1; uu++) {
pDesc = &(pDevice->aRD1Ring[uu]);
pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
pDesc->rd0.owner = OWNED_BY_NIC;
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 8be3e21..55405e0 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -85,7 +85,7 @@
/* BUILD OBJ mode */
-#define AVAIL_TD(p, q) ((p)->sOpts.tx_descs[(q)] - ((p)->iTDUsed[(q)]))
+#define AVAIL_TD(p, q) ((p)->opts.tx_descs[(q)] - ((p)->iTDUsed[(q)]))
/* 0:11A 1:11B 2:11G */
#define BB_TYPE_11A 0
@@ -159,7 +159,7 @@ struct vnt_private {
struct vnt_rx_desc *aRD1Ring;
struct vnt_rx_desc *pCurrRD[TYPE_MAXRD];
- struct vnt_options sOpts;
+ struct vnt_options opts;
u32 flags;
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index d305d7a..fefbf82 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -168,25 +168,25 @@ static void vt6655_remove(struct pci_dev *pcid)
static void device_get_options(struct vnt_private *priv)
{
- struct vnt_options *pOpts = &priv->sOpts;
+ struct vnt_options *opts = &priv->opts;
- pOpts->rx_descs0 = RX_DESC_DEF0;
- pOpts->rx_descs1 = RX_DESC_DEF1;
- pOpts->tx_descs[0] = TX_DESC_DEF0;
- pOpts->tx_descs[1] = TX_DESC_DEF1;
- pOpts->int_works = INT_WORKS_DEF;
+ opts->rx_descs0 = RX_DESC_DEF0;
+ opts->rx_descs1 = RX_DESC_DEF1;
+ opts->tx_descs[0] = TX_DESC_DEF0;
+ opts->tx_descs[1] = TX_DESC_DEF1;
+ opts->int_works = INT_WORKS_DEF;
- pOpts->short_retry = SHORT_RETRY_DEF;
- pOpts->long_retry = LONG_RETRY_DEF;
- pOpts->bbp_type = BBP_TYPE_DEF;
+ opts->short_retry = SHORT_RETRY_DEF;
+ opts->long_retry = LONG_RETRY_DEF;
+ opts->bbp_type = BBP_TYPE_DEF;
}
static void
device_set_options(struct vnt_private *priv)
{
- priv->byShortRetryLimit = priv->sOpts.short_retry;
- priv->byLongRetryLimit = priv->sOpts.long_retry;
- priv->byBBType = priv->sOpts.bbp_type;
+ priv->byShortRetryLimit = priv->opts.short_retry;
+ priv->byLongRetryLimit = priv->opts.long_retry;
+ priv->byBBType = priv->opts.bbp_type;
priv->byPacketType = priv->byBBType;
priv->byAutoFBCtrl = AUTO_FB_0;
priv->bUpdateBBVGA = true;
@@ -452,10 +452,10 @@ static bool device_init_rings(struct vnt_private *priv)
/*allocate all RD/TD rings a single pool*/
vir_pool = dma_zalloc_coherent(&priv->pcid->dev,
- priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
- priv->sOpts.tx_descs[1] * sizeof(struct vnt_tx_desc),
+ priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc) +
+ priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc) +
+ priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
+ priv->opts.tx_descs[1] * sizeof(struct vnt_tx_desc),
&priv->pool_dma, GFP_ATOMIC);
if (vir_pool == NULL) {
dev_err(&priv->pcid->dev, "allocate desc dma memory failed\n");
@@ -464,15 +464,15 @@ static bool device_init_rings(struct vnt_private *priv)
priv->aRD0Ring = vir_pool;
priv->aRD1Ring = vir_pool +
- priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc);
+ priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
priv->rd0_pool_dma = priv->pool_dma;
priv->rd1_pool_dma = priv->rd0_pool_dma +
- priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc);
+ priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
priv->tx0_bufs = dma_zalloc_coherent(&priv->pcid->dev,
- priv->sOpts.tx_descs[0] * PKT_BUF_SZ +
- priv->sOpts.tx_descs[1] * PKT_BUF_SZ +
+ priv->opts.tx_descs[0] * PKT_BUF_SZ +
+ priv->opts.tx_descs[1] * PKT_BUF_SZ +
CB_BEACON_BUF_SIZE +
CB_MAX_BUF_SIZE,
&priv->tx_bufs_dma0,
@@ -481,44 +481,44 @@ static bool device_init_rings(struct vnt_private *priv)
dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");
dma_free_coherent(&priv->pcid->dev,
- priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
- priv->sOpts.tx_descs[1] * sizeof(struct vnt_tx_desc),
+ priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc) +
+ priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc) +
+ priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
+ priv->opts.tx_descs[1] * sizeof(struct vnt_tx_desc),
vir_pool, priv->pool_dma);
return false;
}
priv->td0_pool_dma = priv->rd1_pool_dma +
- priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc);
+ priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc);
priv->td1_pool_dma = priv->td0_pool_dma +
- priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc);
+ priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc);
/* vir_pool: pvoid type */
priv->apTD0Rings = vir_pool
- + priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc)
- + priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc);
+ + priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc)
+ + priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc);
priv->apTD1Rings = vir_pool
- + priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc)
- + priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc)
- + priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc);
+ + priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc)
+ + priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc)
+ + priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc);
priv->tx1_bufs = priv->tx0_bufs +
- priv->sOpts.tx_descs[0] * PKT_BUF_SZ;
+ priv->opts.tx_descs[0] * PKT_BUF_SZ;
priv->tx_beacon_bufs = priv->tx1_bufs +
- priv->sOpts.tx_descs[1] * PKT_BUF_SZ;
+ priv->opts.tx_descs[1] * PKT_BUF_SZ;
priv->pbyTmpBuff = priv->tx_beacon_bufs +
CB_BEACON_BUF_SIZE;
priv->tx_bufs_dma1 = priv->tx_bufs_dma0 +
- priv->sOpts.tx_descs[0] * PKT_BUF_SZ;
+ priv->opts.tx_descs[0] * PKT_BUF_SZ;
priv->tx_beacon_dma = priv->tx_bufs_dma1 +
- priv->sOpts.tx_descs[1] * PKT_BUF_SZ;
+ priv->opts.tx_descs[1] * PKT_BUF_SZ;
return true;
}
@@ -526,16 +526,16 @@ static bool device_init_rings(struct vnt_private *priv)
static void device_free_rings(struct vnt_private *priv)
{
dma_free_coherent(&priv->pcid->dev,
- priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
- priv->sOpts.tx_descs[1] * sizeof(struct vnt_tx_desc),
+ priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc) +
+ priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc) +
+ priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
+ priv->opts.tx_descs[1] * sizeof(struct vnt_tx_desc),
priv->aRD0Ring, priv->pool_dma);
if (priv->tx0_bufs)
dma_free_coherent(&priv->pcid->dev,
- priv->sOpts.tx_descs[0] * PKT_BUF_SZ +
- priv->sOpts.tx_descs[1] * PKT_BUF_SZ +
+ priv->opts.tx_descs[0] * PKT_BUF_SZ +
+ priv->opts.tx_descs[1] * PKT_BUF_SZ +
CB_BEACON_BUF_SIZE +
CB_MAX_BUF_SIZE,
priv->tx0_bufs, priv->tx_bufs_dma0);
@@ -548,7 +548,7 @@ static void device_init_rd0_ring(struct vnt_private *priv)
struct vnt_rx_desc *desc;
/* Init the RD0 ring entries */
- for (i = 0; i < priv->sOpts.rx_descs0;
+ for (i = 0; i < priv->opts.rx_descs0;
i ++, curr += sizeof(struct vnt_rx_desc)) {
desc = &priv->aRD0Ring[i];
desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_ATOMIC);
@@ -556,7 +556,7 @@ static void device_init_rd0_ring(struct vnt_private *priv)
if (!device_alloc_rx_buf(priv, desc))
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
- desc->next = &(priv->aRD0Ring[(i+1) % priv->sOpts.rx_descs0]);
+ desc->next = &(priv->aRD0Ring[(i+1) % priv->opts.rx_descs0]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc));
}
@@ -572,7 +572,7 @@ static void device_init_rd1_ring(struct vnt_private *priv)
struct vnt_rx_desc *desc;
/* Init the RD1 ring entries */
- for (i = 0; i < priv->sOpts.rx_descs1;
+ for (i = 0; i < priv->opts.rx_descs1;
i ++, curr += sizeof(struct vnt_rx_desc)) {
desc = &priv->aRD1Ring[i];
desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_ATOMIC);
@@ -580,7 +580,7 @@ static void device_init_rd1_ring(struct vnt_private *priv)
if (!device_alloc_rx_buf(priv, desc))
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
- desc->next = &(priv->aRD1Ring[(i+1) % priv->sOpts.rx_descs1]);
+ desc->next = &(priv->aRD1Ring[(i+1) % priv->opts.rx_descs1]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc));
}
@@ -593,7 +593,7 @@ static void device_free_rd0_ring(struct vnt_private *priv)
{
int i;
- for (i = 0; i < priv->sOpts.rx_descs0; i++) {
+ for (i = 0; i < priv->opts.rx_descs0; i++) {
struct vnt_rx_desc *desc = &(priv->aRD0Ring[i]);
struct vnt_rd_info *rd_info = desc->rd_info;
@@ -610,7 +610,7 @@ static void device_free_rd1_ring(struct vnt_private *priv)
{
int i;
- for (i = 0; i < priv->sOpts.rx_descs1; i++) {
+ for (i = 0; i < priv->opts.rx_descs1; i++) {
struct vnt_rx_desc *desc = &priv->aRD1Ring[i];
struct vnt_rd_info *rd_info = desc->rd_info;
@@ -630,7 +630,7 @@ static void device_init_td0_ring(struct vnt_private *priv)
struct vnt_tx_desc *desc;
curr = priv->td0_pool_dma;
- for (i = 0; i < priv->sOpts.tx_descs[0];
+ for (i = 0; i < priv->opts.tx_descs[0];
i++, curr += sizeof(struct vnt_tx_desc)) {
desc = &priv->apTD0Rings[i];
desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_ATOMIC);
@@ -638,7 +638,7 @@ static void device_init_td0_ring(struct vnt_private *priv)
desc->td_info->buf = priv->tx0_bufs + i * PKT_BUF_SZ;
desc->td_info->buf_dma = priv->tx_bufs_dma0 + i * PKT_BUF_SZ;
- desc->next = &(priv->apTD0Rings[(i+1) % priv->sOpts.tx_descs[0]]);
+ desc->next = &(priv->apTD0Rings[(i+1) % priv->opts.tx_descs[0]]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
}
@@ -655,7 +655,7 @@ static void device_init_td1_ring(struct vnt_private *priv)
/* Init the TD ring entries */
curr = priv->td1_pool_dma;
- for (i = 0; i < priv->sOpts.tx_descs[1];
+ for (i = 0; i < priv->opts.tx_descs[1];
i++, curr += sizeof(struct vnt_tx_desc)) {
desc = &priv->apTD1Rings[i];
desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_ATOMIC);
@@ -663,7 +663,7 @@ static void device_init_td1_ring(struct vnt_private *priv)
desc->td_info->buf = priv->tx1_bufs + i * PKT_BUF_SZ;
desc->td_info->buf_dma = priv->tx_bufs_dma1 + i * PKT_BUF_SZ;
- desc->next = &(priv->apTD1Rings[(i + 1) % priv->sOpts.tx_descs[1]]);
+ desc->next = &(priv->apTD1Rings[(i + 1) % priv->opts.tx_descs[1]]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
}
@@ -676,7 +676,7 @@ static void device_free_td0_ring(struct vnt_private *priv)
{
int i;
- for (i = 0; i < priv->sOpts.tx_descs[0]; i++) {
+ for (i = 0; i < priv->opts.tx_descs[0]; i++) {
struct vnt_tx_desc *desc = &priv->apTD0Rings[i];
struct vnt_td_info *td_info = desc->td_info;
@@ -689,7 +689,7 @@ static void device_free_td1_ring(struct vnt_private *priv)
{
int i;
- for (i = 0; i < priv->sOpts.tx_descs[1]; i++) {
+ for (i = 0; i < priv->opts.tx_descs[1]; i++) {
struct vnt_tx_desc *desc = &priv->apTD1Rings[i];
struct vnt_td_info *td_info = desc->td_info;
@@ -1057,7 +1057,7 @@ static void vnt_interrupt_process(struct vnt_private *priv)
MACvReceive0(priv->PortOffset);
MACvReceive1(priv->PortOffset);
- if (max_count > priv->sOpts.int_works)
+ if (max_count > priv->opts.int_works)
break;
}
--
2.5.0
Since this only contains one function and used only twice remove
inline altogether.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device.h | 4 ----
drivers/staging/vt6655/device_main.c | 4 ++--
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 0002049..8be3e21 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -306,8 +306,4 @@ struct vnt_private {
struct ieee80211_low_level_stats low_stats;
};
-static inline struct vnt_td_info *alloc_td_info(void)
-{
- return kzalloc(sizeof(struct vnt_td_info), GFP_ATOMIC);
-}
#endif
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index aa8f750..d305d7a 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -633,7 +633,7 @@ static void device_init_td0_ring(struct vnt_private *priv)
for (i = 0; i < priv->sOpts.tx_descs[0];
i++, curr += sizeof(struct vnt_tx_desc)) {
desc = &priv->apTD0Rings[i];
- desc->td_info = alloc_td_info();
+ desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_ATOMIC);
desc->td_info->buf = priv->tx0_bufs + i * PKT_BUF_SZ;
desc->td_info->buf_dma = priv->tx_bufs_dma0 + i * PKT_BUF_SZ;
@@ -658,7 +658,7 @@ static void device_init_td1_ring(struct vnt_private *priv)
for (i = 0; i < priv->sOpts.tx_descs[1];
i++, curr += sizeof(struct vnt_tx_desc)) {
desc = &priv->apTD1Rings[i];
- desc->td_info = alloc_td_info();
+ desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_ATOMIC);
desc->td_info->buf = priv->tx1_bufs + i * PKT_BUF_SZ;
desc->td_info->buf_dma = priv->tx_bufs_dma1 + i * PKT_BUF_SZ;
--
2.5.0
None of these are used in driver anymore.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device.h | 64 -----------------------------------------
1 file changed, 64 deletions(-)
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 271a719..4b8573b 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -60,10 +60,6 @@
#include <linux/wireless.h>
#include <net/iw_handler.h> /* New driver API */
-#ifndef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
-#define WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
-#endif
-
/* device specific */
#include "device_cfg.h"
@@ -87,30 +83,8 @@
#define RATE_36M 9
#define RATE_48M 10
#define RATE_54M 11
-#define RATE_AUTO 12
#define MAX_RATE 12
-#define MAC_MAX_CONTEXT_REG (256+128)
-
-#define MAX_MULTICAST_ADDRESS_NUM 32
-#define MULTICAST_ADDRESS_LIST_SIZE (MAX_MULTICAST_ADDRESS_NUM * ETH_ALEN)
-
-#define DUPLICATE_RX_CACHE_LENGTH 5
-
-#define NUM_KEY_ENTRY 11
-
-#define TX_WEP_NONE 0
-#define TX_WEP_OTF 1
-#define TX_WEP_SW 2
-#define TX_WEP_SWOTP 3
-#define TX_WEP_OTPSW 4
-#define TX_WEP_SW232 5
-
-#define KEYSEL_WEP40 0
-#define KEYSEL_WEP104 1
-#define KEYSEL_TKIP 2
-#define KEYSEL_CCMP 3
-
#define AUTO_FB_NONE 0
#define AUTO_FB_0 1
#define AUTO_FB_1 2
@@ -126,26 +100,15 @@
#define ANT_RXD_TXB 4
#define ANT_UNKNOWN 0xFF
-#define MAXCHECKHANGCNT 4
-
#define BB_VGA_LEVEL 4
#define BB_VGA_CHANGE_THRESHOLD 16
-#ifndef RUN_AT
-#define RUN_AT(x) (jiffies+(x))
-#endif
-
#define MAKE_BEACON_RESERVED 10 /* (us) */
-/* DMA related */
-#define RESERV_AC0DMA 4
-
/* BUILD OBJ mode */
#define AVAIL_TD(p, q) ((p)->sOpts.nTxDescs[(q)] - ((p)->iTDUsed[(q)]))
-#define NUM 64
-
/* 0:11A 1:11B 2:11G */
#define BB_TYPE_11A 0
#define BB_TYPE_11B 1
@@ -162,33 +125,6 @@ typedef enum {
OWNED_BY_NIC = 1
} DEVICE_OWNER_TYPE, *PDEVICE_OWNER_TYPE;
-/* flags for options */
-#define DEVICE_FLAGS_IP_ALIGN 0x00000001UL
-#define DEVICE_FLAGS_PREAMBLE_TYPE 0x00000002UL
-#define DEVICE_FLAGS_OP_MODE 0x00000004UL
-#define DEVICE_FLAGS_PS_MODE 0x00000008UL
-#define DEVICE_FLAGS_80211h_MODE 0x00000010UL
-#define DEVICE_FLAGS_DiversityANT 0x00000020UL
-
-/* flags for driver status */
-#define DEVICE_FLAGS_OPENED 0x00010000UL
-#define DEVICE_FLAGS_WOL_ENABLED 0x00080000UL
-/* flags for capabilities */
-#define DEVICE_FLAGS_TX_ALIGN 0x01000000UL
-#define DEVICE_FLAGS_HAVE_CAM 0x02000000UL
-#define DEVICE_FLAGS_FLOW_CTRL 0x04000000UL
-
-/* flags for MII status */
-#define DEVICE_LINK_FAIL 0x00000001UL
-#define DEVICE_SPEED_10 0x00000002UL
-#define DEVICE_SPEED_100 0x00000004UL
-#define DEVICE_SPEED_1000 0x00000008UL
-#define DEVICE_DUPLEX_FULL 0x00000010UL
-#define DEVICE_AUTONEG_ENABLE 0x00000020UL
-#define DEVICE_FORCED_BY_EEPROM 0x00000040UL
-/* for device_set_media_duplex */
-#define DEVICE_LINK_CHANGE 0x00000001UL
-
typedef struct __device_opt {
int nRxDescs0; /* Number of RX descriptors0 */
int nRxDescs1; /* Number of RX descriptors1 */
--
2.5.0
with struct vnt_options and members
rx_descs0 for nRxDescs0
rx_descs1 for nRxDescs1
tx_descs for nTxDescs
int_works
short_retry
long_retry
bbp_type
flags
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/card.c | 8 ++--
drivers/staging/vt6655/device.h | 24 +++++-----
drivers/staging/vt6655/device_main.c | 92 ++++++++++++++++++------------------
3 files changed, 62 insertions(+), 62 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 5c7f07e..71c9b97 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -523,12 +523,12 @@ CARDvSafeResetTx(
for (uu = 0; uu < TYPE_MAXTD; uu++)
pDevice->iTDUsed[uu] = 0;
- for (uu = 0; uu < pDevice->sOpts.nTxDescs[0]; uu++) {
+ for (uu = 0; uu < pDevice->sOpts.tx_descs[0]; uu++) {
pCurrTD = &(pDevice->apTD0Rings[uu]);
pCurrTD->td0.owner = OWNED_BY_HOST;
/* init all Tx Packet pointer to NULL */
}
- for (uu = 0; uu < pDevice->sOpts.nTxDescs[1]; uu++) {
+ for (uu = 0; uu < pDevice->sOpts.tx_descs[1]; uu++) {
pCurrTD = &(pDevice->apTD1Rings[uu]);
pCurrTD->td0.owner = OWNED_BY_HOST;
/* init all Tx Packet pointer to NULL */
@@ -571,7 +571,7 @@ CARDvSafeResetRx(
pDevice->pCurrRD[1] = &(pDevice->aRD1Ring[0]);
/* init state, all RD is chip's */
- for (uu = 0; uu < pDevice->sOpts.nRxDescs0; uu++) {
+ for (uu = 0; uu < pDevice->sOpts.rx_descs0; uu++) {
pDesc = &(pDevice->aRD0Ring[uu]);
pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
pDesc->rd0.owner = OWNED_BY_NIC;
@@ -579,7 +579,7 @@ CARDvSafeResetRx(
}
/* init state, all RD is chip's */
- for (uu = 0; uu < pDevice->sOpts.nRxDescs1; uu++) {
+ for (uu = 0; uu < pDevice->sOpts.rx_descs1; uu++) {
pDesc = &(pDevice->aRD1Ring[uu]);
pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
pDesc->rd0.owner = OWNED_BY_NIC;
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 83bb68b..aca6e00 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -85,7 +85,7 @@
/* BUILD OBJ mode */
-#define AVAIL_TD(p, q) ((p)->sOpts.nTxDescs[(q)] - ((p)->iTDUsed[(q)]))
+#define AVAIL_TD(p, q) ((p)->sOpts.tx_descs[(q)] - ((p)->iTDUsed[(q)]))
/* 0:11A 1:11B 2:11G */
#define BB_TYPE_11A 0
@@ -101,16 +101,16 @@
#define OWNED_BY_HOST 0
#define OWNED_BY_NIC 1
-typedef struct __device_opt {
- int nRxDescs0; /* Number of RX descriptors0 */
- int nRxDescs1; /* Number of RX descriptors1 */
- int nTxDescs[2]; /* Number of TX descriptors 0, 1 */
- int int_works; /* interrupt limits */
- int short_retry;
- int long_retry;
- int bbp_type;
- u32 flags;
-} OPTIONS, *POPTIONS;
+struct vnt_options {
+ int rx_descs0; /* Number of RX descriptors0 */
+ int rx_descs1; /* Number of RX descriptors1 */
+ int tx_descs[2]; /* Number of TX descriptors 0, 1 */
+ int int_works; /* interrupt limits */
+ int short_retry;
+ int long_retry;
+ int bbp_type;
+ u32 flags;
+};
struct vnt_private {
struct pci_dev *pcid;
@@ -159,7 +159,7 @@ struct vnt_private {
struct vnt_rx_desc *aRD1Ring;
struct vnt_rx_desc *pCurrRD[TYPE_MAXRD];
- OPTIONS sOpts;
+ struct vnt_options sOpts;
u32 flags;
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 0ed82a64..8bca3fc 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -168,12 +168,12 @@ static void vt6655_remove(struct pci_dev *pcid)
static void device_get_options(struct vnt_private *priv)
{
- POPTIONS pOpts = &priv->sOpts;
+ struct vnt_options *pOpts = &priv->sOpts;
- pOpts->nRxDescs0 = RX_DESC_DEF0;
- pOpts->nRxDescs1 = RX_DESC_DEF1;
- pOpts->nTxDescs[0] = TX_DESC_DEF0;
- pOpts->nTxDescs[1] = TX_DESC_DEF1;
+ pOpts->rx_descs0 = RX_DESC_DEF0;
+ pOpts->rx_descs1 = RX_DESC_DEF1;
+ pOpts->tx_descs[0] = TX_DESC_DEF0;
+ pOpts->tx_descs[1] = TX_DESC_DEF1;
pOpts->int_works = INT_WORKS_DEF;
pOpts->short_retry = SHORT_RETRY_DEF;
@@ -452,10 +452,10 @@ static bool device_init_rings(struct vnt_private *priv)
/*allocate all RD/TD rings a single pool*/
vir_pool = dma_zalloc_coherent(&priv->pcid->dev,
- priv->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
- priv->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
+ priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc) +
+ priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc) +
+ priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
+ priv->sOpts.tx_descs[1] * sizeof(struct vnt_tx_desc),
&priv->pool_dma, GFP_ATOMIC);
if (vir_pool == NULL) {
dev_err(&priv->pcid->dev, "allocate desc dma memory failed\n");
@@ -464,15 +464,15 @@ static bool device_init_rings(struct vnt_private *priv)
priv->aRD0Ring = vir_pool;
priv->aRD1Ring = vir_pool +
- priv->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc);
+ priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc);
priv->rd0_pool_dma = priv->pool_dma;
priv->rd1_pool_dma = priv->rd0_pool_dma +
- priv->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc);
+ priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc);
priv->tx0_bufs = dma_zalloc_coherent(&priv->pcid->dev,
- priv->sOpts.nTxDescs[0] * PKT_BUF_SZ +
- priv->sOpts.nTxDescs[1] * PKT_BUF_SZ +
+ priv->sOpts.tx_descs[0] * PKT_BUF_SZ +
+ priv->sOpts.tx_descs[1] * PKT_BUF_SZ +
CB_BEACON_BUF_SIZE +
CB_MAX_BUF_SIZE,
&priv->tx_bufs_dma0,
@@ -481,44 +481,44 @@ static bool device_init_rings(struct vnt_private *priv)
dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");
dma_free_coherent(&priv->pcid->dev,
- priv->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
- priv->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
+ priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc) +
+ priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc) +
+ priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
+ priv->sOpts.tx_descs[1] * sizeof(struct vnt_tx_desc),
vir_pool, priv->pool_dma);
return false;
}
priv->td0_pool_dma = priv->rd1_pool_dma +
- priv->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc);
+ priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc);
priv->td1_pool_dma = priv->td0_pool_dma +
- priv->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc);
+ priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc);
/* vir_pool: pvoid type */
priv->apTD0Rings = vir_pool
- + priv->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc)
- + priv->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc);
+ + priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc)
+ + priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc);
priv->apTD1Rings = vir_pool
- + priv->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc)
- + priv->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc)
- + priv->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc);
+ + priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc)
+ + priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc)
+ + priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc);
priv->tx1_bufs = priv->tx0_bufs +
- priv->sOpts.nTxDescs[0] * PKT_BUF_SZ;
+ priv->sOpts.tx_descs[0] * PKT_BUF_SZ;
priv->tx_beacon_bufs = priv->tx1_bufs +
- priv->sOpts.nTxDescs[1] * PKT_BUF_SZ;
+ priv->sOpts.tx_descs[1] * PKT_BUF_SZ;
priv->pbyTmpBuff = priv->tx_beacon_bufs +
CB_BEACON_BUF_SIZE;
priv->tx_bufs_dma1 = priv->tx_bufs_dma0 +
- priv->sOpts.nTxDescs[0] * PKT_BUF_SZ;
+ priv->sOpts.tx_descs[0] * PKT_BUF_SZ;
priv->tx_beacon_dma = priv->tx_bufs_dma1 +
- priv->sOpts.nTxDescs[1] * PKT_BUF_SZ;
+ priv->sOpts.tx_descs[1] * PKT_BUF_SZ;
return true;
}
@@ -526,16 +526,16 @@ static bool device_init_rings(struct vnt_private *priv)
static void device_free_rings(struct vnt_private *priv)
{
dma_free_coherent(&priv->pcid->dev,
- priv->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) +
- priv->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
- priv->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
+ priv->sOpts.rx_descs0 * sizeof(struct vnt_rx_desc) +
+ priv->sOpts.rx_descs1 * sizeof(struct vnt_rx_desc) +
+ priv->sOpts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
+ priv->sOpts.tx_descs[1] * sizeof(struct vnt_tx_desc),
priv->aRD0Ring, priv->pool_dma);
if (priv->tx0_bufs)
dma_free_coherent(&priv->pcid->dev,
- priv->sOpts.nTxDescs[0] * PKT_BUF_SZ +
- priv->sOpts.nTxDescs[1] * PKT_BUF_SZ +
+ priv->sOpts.tx_descs[0] * PKT_BUF_SZ +
+ priv->sOpts.tx_descs[1] * PKT_BUF_SZ +
CB_BEACON_BUF_SIZE +
CB_MAX_BUF_SIZE,
priv->tx0_bufs, priv->tx_bufs_dma0);
@@ -548,7 +548,7 @@ static void device_init_rd0_ring(struct vnt_private *priv)
struct vnt_rx_desc *desc;
/* Init the RD0 ring entries */
- for (i = 0; i < priv->sOpts.nRxDescs0;
+ for (i = 0; i < priv->sOpts.rx_descs0;
i ++, curr += sizeof(struct vnt_rx_desc)) {
desc = &priv->aRD0Ring[i];
desc->rd_info = alloc_rd_info();
@@ -556,7 +556,7 @@ static void device_init_rd0_ring(struct vnt_private *priv)
if (!device_alloc_rx_buf(priv, desc))
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
- desc->next = &(priv->aRD0Ring[(i+1) % priv->sOpts.nRxDescs0]);
+ desc->next = &(priv->aRD0Ring[(i+1) % priv->sOpts.rx_descs0]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc));
}
@@ -572,7 +572,7 @@ static void device_init_rd1_ring(struct vnt_private *priv)
struct vnt_rx_desc *desc;
/* Init the RD1 ring entries */
- for (i = 0; i < priv->sOpts.nRxDescs1;
+ for (i = 0; i < priv->sOpts.rx_descs1;
i ++, curr += sizeof(struct vnt_rx_desc)) {
desc = &priv->aRD1Ring[i];
desc->rd_info = alloc_rd_info();
@@ -580,7 +580,7 @@ static void device_init_rd1_ring(struct vnt_private *priv)
if (!device_alloc_rx_buf(priv, desc))
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
- desc->next = &(priv->aRD1Ring[(i+1) % priv->sOpts.nRxDescs1]);
+ desc->next = &(priv->aRD1Ring[(i+1) % priv->sOpts.rx_descs1]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc));
}
@@ -593,7 +593,7 @@ static void device_free_rd0_ring(struct vnt_private *priv)
{
int i;
- for (i = 0; i < priv->sOpts.nRxDescs0; i++) {
+ for (i = 0; i < priv->sOpts.rx_descs0; i++) {
struct vnt_rx_desc *desc = &(priv->aRD0Ring[i]);
struct vnt_rd_info *rd_info = desc->rd_info;
@@ -610,7 +610,7 @@ static void device_free_rd1_ring(struct vnt_private *priv)
{
int i;
- for (i = 0; i < priv->sOpts.nRxDescs1; i++) {
+ for (i = 0; i < priv->sOpts.rx_descs1; i++) {
struct vnt_rx_desc *desc = &priv->aRD1Ring[i];
struct vnt_rd_info *rd_info = desc->rd_info;
@@ -630,7 +630,7 @@ static void device_init_td0_ring(struct vnt_private *priv)
struct vnt_tx_desc *desc;
curr = priv->td0_pool_dma;
- for (i = 0; i < priv->sOpts.nTxDescs[0];
+ for (i = 0; i < priv->sOpts.tx_descs[0];
i++, curr += sizeof(struct vnt_tx_desc)) {
desc = &priv->apTD0Rings[i];
desc->td_info = alloc_td_info();
@@ -638,7 +638,7 @@ static void device_init_td0_ring(struct vnt_private *priv)
desc->td_info->buf = priv->tx0_bufs + i * PKT_BUF_SZ;
desc->td_info->buf_dma = priv->tx_bufs_dma0 + i * PKT_BUF_SZ;
- desc->next = &(priv->apTD0Rings[(i+1) % priv->sOpts.nTxDescs[0]]);
+ desc->next = &(priv->apTD0Rings[(i+1) % priv->sOpts.tx_descs[0]]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
}
@@ -655,7 +655,7 @@ static void device_init_td1_ring(struct vnt_private *priv)
/* Init the TD ring entries */
curr = priv->td1_pool_dma;
- for (i = 0; i < priv->sOpts.nTxDescs[1];
+ for (i = 0; i < priv->sOpts.tx_descs[1];
i++, curr += sizeof(struct vnt_tx_desc)) {
desc = &priv->apTD1Rings[i];
desc->td_info = alloc_td_info();
@@ -663,7 +663,7 @@ static void device_init_td1_ring(struct vnt_private *priv)
desc->td_info->buf = priv->tx1_bufs + i * PKT_BUF_SZ;
desc->td_info->buf_dma = priv->tx_bufs_dma1 + i * PKT_BUF_SZ;
- desc->next = &(priv->apTD1Rings[(i + 1) % priv->sOpts.nTxDescs[1]]);
+ desc->next = &(priv->apTD1Rings[(i + 1) % priv->sOpts.tx_descs[1]]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
}
@@ -676,7 +676,7 @@ static void device_free_td0_ring(struct vnt_private *priv)
{
int i;
- for (i = 0; i < priv->sOpts.nTxDescs[0]; i++) {
+ for (i = 0; i < priv->sOpts.tx_descs[0]; i++) {
struct vnt_tx_desc *desc = &priv->apTD0Rings[i];
struct vnt_td_info *td_info = desc->td_info;
@@ -689,7 +689,7 @@ static void device_free_td1_ring(struct vnt_private *priv)
{
int i;
- for (i = 0; i < priv->sOpts.nTxDescs[1]; i++) {
+ for (i = 0; i < priv->sOpts.tx_descs[1]; i++) {
struct vnt_tx_desc *desc = &priv->apTD1Rings[i];
struct vnt_td_info *td_info = desc->td_info;
--
2.5.0
Removing camel case.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/card.c | 386 +++++++++++++++++++++---------------------
1 file changed, 193 insertions(+), 193 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index c45e494..76ad036 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -197,13 +197,13 @@ s_vCalculateOFDMRParameter(
*
* Parameters:
* In:
- * pDevice - The adapter to be set
+ * priv - The adapter to be set
* Out:
* none
*
* Return Value: None.
*/
-bool CARDbSetPhyParameter(struct vnt_private *pDevice, u8 bb_type)
+bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
{
unsigned char byCWMaxMin = 0;
unsigned char bySlot = 0;
@@ -214,77 +214,77 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, u8 bb_type)
/* Set SIFS, DIFS, EIFS, SlotTime, CwMin */
if (bb_type == BB_TYPE_11A) {
- if (pDevice->byRFType == RF_AIROHA7230) {
+ if (priv->byRFType == RF_AIROHA7230) {
/* AL7230 use single PAPE and connect to PAPE_2.4G */
- MACvSetBBType(pDevice->PortOffset, BB_TYPE_11G);
- pDevice->abyBBVGA[0] = 0x20;
- pDevice->abyBBVGA[2] = 0x10;
- pDevice->abyBBVGA[3] = 0x10;
- BBbReadEmbedded(pDevice, 0xE7, &byData);
+ MACvSetBBType(priv->PortOffset, BB_TYPE_11G);
+ priv->abyBBVGA[0] = 0x20;
+ priv->abyBBVGA[2] = 0x10;
+ priv->abyBBVGA[3] = 0x10;
+ BBbReadEmbedded(priv, 0xE7, &byData);
if (byData == 0x1C)
- BBbWriteEmbedded(pDevice, 0xE7, pDevice->abyBBVGA[0]);
+ BBbWriteEmbedded(priv, 0xE7, priv->abyBBVGA[0]);
- } else if (pDevice->byRFType == RF_UW2452) {
- MACvSetBBType(pDevice->PortOffset, BB_TYPE_11A);
- pDevice->abyBBVGA[0] = 0x18;
- BBbReadEmbedded(pDevice, 0xE7, &byData);
+ } else if (priv->byRFType == RF_UW2452) {
+ MACvSetBBType(priv->PortOffset, BB_TYPE_11A);
+ priv->abyBBVGA[0] = 0x18;
+ BBbReadEmbedded(priv, 0xE7, &byData);
if (byData == 0x14) {
- BBbWriteEmbedded(pDevice, 0xE7, pDevice->abyBBVGA[0]);
- BBbWriteEmbedded(pDevice, 0xE1, 0x57);
+ BBbWriteEmbedded(priv, 0xE7, priv->abyBBVGA[0]);
+ BBbWriteEmbedded(priv, 0xE1, 0x57);
}
} else {
- MACvSetBBType(pDevice->PortOffset, BB_TYPE_11A);
+ MACvSetBBType(priv->PortOffset, BB_TYPE_11A);
}
- BBbWriteEmbedded(pDevice, 0x88, 0x03);
+ BBbWriteEmbedded(priv, 0x88, 0x03);
bySlot = C_SLOT_SHORT;
bySIFS = C_SIFS_A;
byDIFS = C_SIFS_A + 2*C_SLOT_SHORT;
byCWMaxMin = 0xA4;
} else if (bb_type == BB_TYPE_11B) {
- MACvSetBBType(pDevice->PortOffset, BB_TYPE_11B);
- if (pDevice->byRFType == RF_AIROHA7230) {
- pDevice->abyBBVGA[0] = 0x1C;
- pDevice->abyBBVGA[2] = 0x00;
- pDevice->abyBBVGA[3] = 0x00;
- BBbReadEmbedded(pDevice, 0xE7, &byData);
+ MACvSetBBType(priv->PortOffset, BB_TYPE_11B);
+ if (priv->byRFType == RF_AIROHA7230) {
+ priv->abyBBVGA[0] = 0x1C;
+ priv->abyBBVGA[2] = 0x00;
+ priv->abyBBVGA[3] = 0x00;
+ BBbReadEmbedded(priv, 0xE7, &byData);
if (byData == 0x20)
- BBbWriteEmbedded(pDevice, 0xE7, pDevice->abyBBVGA[0]);
+ BBbWriteEmbedded(priv, 0xE7, priv->abyBBVGA[0]);
- } else if (pDevice->byRFType == RF_UW2452) {
- pDevice->abyBBVGA[0] = 0x14;
- BBbReadEmbedded(pDevice, 0xE7, &byData);
+ } else if (priv->byRFType == RF_UW2452) {
+ priv->abyBBVGA[0] = 0x14;
+ BBbReadEmbedded(priv, 0xE7, &byData);
if (byData == 0x18) {
- BBbWriteEmbedded(pDevice, 0xE7, pDevice->abyBBVGA[0]);
- BBbWriteEmbedded(pDevice, 0xE1, 0xD3);
+ BBbWriteEmbedded(priv, 0xE7, priv->abyBBVGA[0]);
+ BBbWriteEmbedded(priv, 0xE1, 0xD3);
}
}
- BBbWriteEmbedded(pDevice, 0x88, 0x02);
+ BBbWriteEmbedded(priv, 0x88, 0x02);
bySlot = C_SLOT_LONG;
bySIFS = C_SIFS_BG;
byDIFS = C_SIFS_BG + 2*C_SLOT_LONG;
byCWMaxMin = 0xA5;
} else { /* PK_TYPE_11GA & PK_TYPE_11GB */
- MACvSetBBType(pDevice->PortOffset, BB_TYPE_11G);
- if (pDevice->byRFType == RF_AIROHA7230) {
- pDevice->abyBBVGA[0] = 0x1C;
- pDevice->abyBBVGA[2] = 0x00;
- pDevice->abyBBVGA[3] = 0x00;
- BBbReadEmbedded(pDevice, 0xE7, &byData);
+ MACvSetBBType(priv->PortOffset, BB_TYPE_11G);
+ if (priv->byRFType == RF_AIROHA7230) {
+ priv->abyBBVGA[0] = 0x1C;
+ priv->abyBBVGA[2] = 0x00;
+ priv->abyBBVGA[3] = 0x00;
+ BBbReadEmbedded(priv, 0xE7, &byData);
if (byData == 0x20)
- BBbWriteEmbedded(pDevice, 0xE7, pDevice->abyBBVGA[0]);
+ BBbWriteEmbedded(priv, 0xE7, priv->abyBBVGA[0]);
- } else if (pDevice->byRFType == RF_UW2452) {
- pDevice->abyBBVGA[0] = 0x14;
- BBbReadEmbedded(pDevice, 0xE7, &byData);
+ } else if (priv->byRFType == RF_UW2452) {
+ priv->abyBBVGA[0] = 0x14;
+ BBbReadEmbedded(priv, 0xE7, &byData);
if (byData == 0x18) {
- BBbWriteEmbedded(pDevice, 0xE7, pDevice->abyBBVGA[0]);
- BBbWriteEmbedded(pDevice, 0xE1, 0xD3);
+ BBbWriteEmbedded(priv, 0xE7, priv->abyBBVGA[0]);
+ BBbWriteEmbedded(priv, 0xE1, 0xD3);
}
}
- BBbWriteEmbedded(pDevice, 0x88, 0x08);
+ BBbWriteEmbedded(priv, 0x88, 0x08);
bySIFS = C_SIFS_BG;
- if (pDevice->bShortSlotTime) {
+ if (priv->bShortSlotTime) {
bySlot = C_SLOT_SHORT;
byDIFS = C_SIFS_BG + 2*C_SLOT_SHORT;
} else {
@@ -295,14 +295,14 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, u8 bb_type)
byCWMaxMin = 0xa4;
for (i = RATE_54M; i >= RATE_6M; i--) {
- if (pDevice->basic_rates & ((u32)(0x1 << i))) {
+ if (priv->basic_rates & ((u32)(0x1 << i))) {
byCWMaxMin |= 0x1;
break;
}
}
}
- if (pDevice->byRFType == RF_RFMD2959) {
+ if (priv->byRFType == RF_RFMD2959) {
/*
* bcs TX_PE will reserve 3 us hardware's processing
* time here is 2 us.
@@ -316,32 +316,32 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, u8 bb_type)
*/
}
- if (pDevice->bySIFS != bySIFS) {
- pDevice->bySIFS = bySIFS;
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_SIFS, pDevice->bySIFS);
+ if (priv->bySIFS != bySIFS) {
+ priv->bySIFS = bySIFS;
+ VNSvOutPortB(priv->PortOffset + MAC_REG_SIFS, priv->bySIFS);
}
- if (pDevice->byDIFS != byDIFS) {
- pDevice->byDIFS = byDIFS;
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_DIFS, pDevice->byDIFS);
+ if (priv->byDIFS != byDIFS) {
+ priv->byDIFS = byDIFS;
+ VNSvOutPortB(priv->PortOffset + MAC_REG_DIFS, priv->byDIFS);
}
- if (pDevice->byEIFS != C_EIFS) {
- pDevice->byEIFS = C_EIFS;
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_EIFS, pDevice->byEIFS);
+ if (priv->byEIFS != C_EIFS) {
+ priv->byEIFS = C_EIFS;
+ VNSvOutPortB(priv->PortOffset + MAC_REG_EIFS, priv->byEIFS);
}
- if (pDevice->bySlot != bySlot) {
- pDevice->bySlot = bySlot;
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_SLOT, pDevice->bySlot);
+ if (priv->bySlot != bySlot) {
+ priv->bySlot = bySlot;
+ VNSvOutPortB(priv->PortOffset + MAC_REG_SLOT, priv->bySlot);
- BBvSetShortSlotTime(pDevice);
+ BBvSetShortSlotTime(priv);
}
- if (pDevice->byCWMaxMin != byCWMaxMin) {
- pDevice->byCWMaxMin = byCWMaxMin;
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_CWMAXMIN0, pDevice->byCWMaxMin);
+ if (priv->byCWMaxMin != byCWMaxMin) {
+ priv->byCWMaxMin = byCWMaxMin;
+ VNSvOutPortB(priv->PortOffset + MAC_REG_CWMAXMIN0, priv->byCWMaxMin);
}
- pDevice->byPacketType = CARDbyGetPktType(pDevice);
+ priv->byPacketType = CARDbyGetPktType(priv);
- CARDvSetRSPINF(pDevice, bb_type);
+ CARDvSetRSPINF(priv, bb_type);
return true;
}
@@ -352,7 +352,7 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, u8 bb_type)
*
* Parameters:
* In:
- * pDevice - The adapter to be sync.
+ * priv - The adapter to be sync.
* byRxRate - data rate of receive beacon
* qwBSSTimestamp - Rx BCN's TSF
* qwLocalTSF - Local TSF
@@ -361,21 +361,21 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, u8 bb_type)
*
* Return Value: none
*/
-bool CARDbUpdateTSF(struct vnt_private *pDevice, unsigned char byRxRate,
+bool CARDbUpdateTSF(struct vnt_private *priv, unsigned char byRxRate,
u64 qwBSSTimestamp)
{
u64 local_tsf;
u64 qwTSFOffset = 0;
- CARDbGetCurrentTSF(pDevice, &local_tsf);
+ CARDbGetCurrentTSF(priv, &local_tsf);
if (qwBSSTimestamp != local_tsf) {
qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp,
local_tsf);
/* adjust TSF, HW's TSF add TSF Offset reg */
- VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST, (u32)qwTSFOffset);
- VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST + 4, (u32)(qwTSFOffset >> 32));
- MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TFTCTL, TFTCTL_TSFSYNCEN);
+ VNSvOutPortD(priv->PortOffset + MAC_REG_TSFOFST, (u32)qwTSFOffset);
+ VNSvOutPortD(priv->PortOffset + MAC_REG_TSFOFST + 4, (u32)(qwTSFOffset >> 32));
+ MACvRegBitsOn(priv->PortOffset, MAC_REG_TFTCTL, TFTCTL_TSFSYNCEN);
}
return true;
}
@@ -386,29 +386,29 @@ bool CARDbUpdateTSF(struct vnt_private *pDevice, unsigned char byRxRate,
*
* Parameters:
* In:
- * pDevice - The adapter to be set.
+ * priv - The adapter to be set.
* wBeaconInterval - Beacon Interval
* Out:
* none
*
* Return Value: true if succeed; otherwise false
*/
-bool CARDbSetBeaconPeriod(struct vnt_private *pDevice,
+bool CARDbSetBeaconPeriod(struct vnt_private *priv,
unsigned short wBeaconInterval)
{
u64 qwNextTBTT = 0;
- CARDbGetCurrentTSF(pDevice, &qwNextTBTT); /* Get Local TSF counter */
+ CARDbGetCurrentTSF(priv, &qwNextTBTT); /* Get Local TSF counter */
qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval);
/* set HW beacon interval */
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_BI, wBeaconInterval);
- pDevice->wBeaconInterval = wBeaconInterval;
+ VNSvOutPortW(priv->PortOffset + MAC_REG_BI, wBeaconInterval);
+ priv->wBeaconInterval = wBeaconInterval;
/* Set NextTBTT */
- VNSvOutPortD(pDevice->PortOffset + MAC_REG_NEXTTBTT, (u32)qwNextTBTT);
- VNSvOutPortD(pDevice->PortOffset + MAC_REG_NEXTTBTT + 4, (u32)(qwNextTBTT >> 32));
- MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN);
+ VNSvOutPortD(priv->PortOffset + MAC_REG_NEXTTBTT, (u32)qwNextTBTT);
+ VNSvOutPortD(priv->PortOffset + MAC_REG_NEXTTBTT + 4, (u32)(qwNextTBTT >> 32));
+ MACvRegBitsOn(priv->PortOffset, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN);
return true;
}
@@ -418,41 +418,41 @@ bool CARDbSetBeaconPeriod(struct vnt_private *pDevice,
*
* Parameters:
* In:
- * pDevice - The adapter to be turned off
+ * priv - The adapter to be turned off
* Out:
* none
*
* Return Value: true if success; otherwise false
*/
-bool CARDbRadioPowerOff(struct vnt_private *pDevice)
+bool CARDbRadioPowerOff(struct vnt_private *priv)
{
bool bResult = true;
- if (pDevice->bRadioOff)
+ if (priv->bRadioOff)
return true;
- switch (pDevice->byRFType) {
+ switch (priv->byRFType) {
case RF_RFMD2959:
- MACvWordRegBitsOff(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_TXPEINV);
- MACvWordRegBitsOn(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE1);
+ MACvWordRegBitsOff(priv->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_TXPEINV);
+ MACvWordRegBitsOn(priv->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE1);
break;
case RF_AIROHA:
case RF_AL2230S:
case RF_AIROHA7230:
- MACvWordRegBitsOff(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE2);
- MACvWordRegBitsOff(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
+ MACvWordRegBitsOff(priv->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE2);
+ MACvWordRegBitsOff(priv->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
break;
}
- MACvRegBitsOff(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_RXON);
+ MACvRegBitsOff(priv->PortOffset, MAC_REG_HOSTCR, HOSTCR_RXON);
- BBvSetDeepSleep(pDevice, pDevice->byLocalID);
+ BBvSetDeepSleep(priv, priv->byLocalID);
- pDevice->bRadioOff = true;
+ priv->bRadioOff = true;
pr_debug("chester power off\n");
- MACvRegBitsOn(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); /* LED issue */
+ MACvRegBitsOn(priv->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); /* LED issue */
return bResult;
}
@@ -461,89 +461,89 @@ bool CARDbRadioPowerOff(struct vnt_private *pDevice)
*
* Parameters:
* In:
- * pDevice - The adapter to be turned on
+ * priv - The adapter to be turned on
* Out:
* none
*
* Return Value: true if success; otherwise false
*/
-bool CARDbRadioPowerOn(struct vnt_private *pDevice)
+bool CARDbRadioPowerOn(struct vnt_private *priv)
{
bool bResult = true;
pr_debug("chester power on\n");
- if (pDevice->bRadioControlOff) {
- if (pDevice->bHWRadioOff)
+ if (priv->bRadioControlOff) {
+ if (priv->bHWRadioOff)
pr_debug("chester bHWRadioOff\n");
- if (pDevice->bRadioControlOff)
+ if (priv->bRadioControlOff)
pr_debug("chester bRadioControlOff\n");
return false; }
- if (!pDevice->bRadioOff) {
+ if (!priv->bRadioOff) {
pr_debug("chester pbRadioOff\n");
return true; }
- BBvExitDeepSleep(pDevice, pDevice->byLocalID);
+ BBvExitDeepSleep(priv, priv->byLocalID);
- MACvRegBitsOn(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_RXON);
+ MACvRegBitsOn(priv->PortOffset, MAC_REG_HOSTCR, HOSTCR_RXON);
- switch (pDevice->byRFType) {
+ switch (priv->byRFType) {
case RF_RFMD2959:
- MACvWordRegBitsOn(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_TXPEINV);
- MACvWordRegBitsOff(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE1);
+ MACvWordRegBitsOn(priv->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_TXPEINV);
+ MACvWordRegBitsOff(priv->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE1);
break;
case RF_AIROHA:
case RF_AL2230S:
case RF_AIROHA7230:
- MACvWordRegBitsOn(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE2 |
+ MACvWordRegBitsOn(priv->PortOffset, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE2 |
SOFTPWRCTL_SWPE3));
break;
}
- pDevice->bRadioOff = false;
+ priv->bRadioOff = false;
pr_debug("chester power on\n");
- MACvRegBitsOff(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); /* LED issue */
+ MACvRegBitsOff(priv->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); /* LED issue */
return bResult;
}
void
CARDvSafeResetTx(
- struct vnt_private *pDevice
+ struct vnt_private *priv
)
{
unsigned int uu;
struct vnt_tx_desc *pCurrTD;
/* initialize TD index */
- pDevice->apTailTD[0] = pDevice->apCurrTD[0] = &(pDevice->apTD0Rings[0]);
- pDevice->apTailTD[1] = pDevice->apCurrTD[1] = &(pDevice->apTD1Rings[0]);
+ priv->apTailTD[0] = priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
+ priv->apTailTD[1] = priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
for (uu = 0; uu < TYPE_MAXTD; uu++)
- pDevice->iTDUsed[uu] = 0;
+ priv->iTDUsed[uu] = 0;
- for (uu = 0; uu < pDevice->opts.tx_descs[0]; uu++) {
- pCurrTD = &(pDevice->apTD0Rings[uu]);
+ for (uu = 0; uu < priv->opts.tx_descs[0]; uu++) {
+ pCurrTD = &(priv->apTD0Rings[uu]);
pCurrTD->td0.owner = OWNED_BY_HOST;
/* init all Tx Packet pointer to NULL */
}
- for (uu = 0; uu < pDevice->opts.tx_descs[1]; uu++) {
- pCurrTD = &(pDevice->apTD1Rings[uu]);
+ for (uu = 0; uu < priv->opts.tx_descs[1]; uu++) {
+ pCurrTD = &(priv->apTD1Rings[uu]);
pCurrTD->td0.owner = OWNED_BY_HOST;
/* init all Tx Packet pointer to NULL */
}
/* set MAC TD pointer */
- MACvSetCurrTXDescAddr(TYPE_TXDMA0, pDevice->PortOffset,
- (pDevice->td0_pool_dma));
+ MACvSetCurrTXDescAddr(TYPE_TXDMA0, priv->PortOffset,
+ (priv->td0_pool_dma));
- MACvSetCurrTXDescAddr(TYPE_AC0DMA, pDevice->PortOffset,
- (pDevice->td1_pool_dma));
+ MACvSetCurrTXDescAddr(TYPE_AC0DMA, priv->PortOffset,
+ (priv->td1_pool_dma));
/* set MAC Beacon TX pointer */
- MACvSetCurrBCNTxDescAddr(pDevice->PortOffset,
- (pDevice->tx_beacon_dma));
+ MACvSetCurrBCNTxDescAddr(priv->PortOffset,
+ (priv->tx_beacon_dma));
}
/*
@@ -552,7 +552,7 @@ CARDvSafeResetTx(
*
* Parameters:
* In:
- * pDevice - Pointer to the adapter
+ * priv - Pointer to the adapter
* Out:
* none
*
@@ -560,41 +560,41 @@ CARDvSafeResetTx(
*/
void
CARDvSafeResetRx(
- struct vnt_private *pDevice
+ struct vnt_private *priv
)
{
unsigned int uu;
struct vnt_rx_desc *pDesc;
/* initialize RD index */
- pDevice->pCurrRD[0] = &(pDevice->aRD0Ring[0]);
- pDevice->pCurrRD[1] = &(pDevice->aRD1Ring[0]);
+ priv->pCurrRD[0] = &(priv->aRD0Ring[0]);
+ priv->pCurrRD[1] = &(priv->aRD1Ring[0]);
/* init state, all RD is chip's */
- for (uu = 0; uu < pDevice->opts.rx_descs0; uu++) {
- pDesc = &(pDevice->aRD0Ring[uu]);
- pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
+ for (uu = 0; uu < priv->opts.rx_descs0; uu++) {
+ pDesc = &(priv->aRD0Ring[uu]);
+ pDesc->rd0.res_count = cpu_to_le16(priv->rx_buf_sz);
pDesc->rd0.owner = OWNED_BY_NIC;
- pDesc->rd1.req_count = cpu_to_le16(pDevice->rx_buf_sz);
+ pDesc->rd1.req_count = cpu_to_le16(priv->rx_buf_sz);
}
/* init state, all RD is chip's */
- for (uu = 0; uu < pDevice->opts.rx_descs1; uu++) {
- pDesc = &(pDevice->aRD1Ring[uu]);
- pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
+ for (uu = 0; uu < priv->opts.rx_descs1; uu++) {
+ pDesc = &(priv->aRD1Ring[uu]);
+ pDesc->rd0.res_count = cpu_to_le16(priv->rx_buf_sz);
pDesc->rd0.owner = OWNED_BY_NIC;
- pDesc->rd1.req_count = cpu_to_le16(pDevice->rx_buf_sz);
+ pDesc->rd1.req_count = cpu_to_le16(priv->rx_buf_sz);
}
/* set perPkt mode */
- MACvRx0PerPktMode(pDevice->PortOffset);
- MACvRx1PerPktMode(pDevice->PortOffset);
+ MACvRx0PerPktMode(priv->PortOffset);
+ MACvRx1PerPktMode(priv->PortOffset);
/* set MAC RD pointer */
- MACvSetCurrRx0DescAddr(pDevice->PortOffset,
- pDevice->rd0_pool_dma);
+ MACvSetCurrRx0DescAddr(priv->PortOffset,
+ priv->rd0_pool_dma);
- MACvSetCurrRx1DescAddr(pDevice->PortOffset,
- pDevice->rd1_pool_dma);
+ MACvSetCurrRx1DescAddr(priv->PortOffset,
+ priv->rd1_pool_dma);
}
/*
@@ -602,20 +602,20 @@ CARDvSafeResetRx(
*
* Parameters:
* In:
- * pDevice - The adapter to be set
+ * priv - The adapter to be set
* wRateIdx - Receiving data rate
* Out:
* none
*
* Return Value: response Control frame rate
*/
-static unsigned short CARDwGetCCKControlRate(struct vnt_private *pDevice,
+static unsigned short CARDwGetCCKControlRate(struct vnt_private *priv,
unsigned short wRateIdx)
{
unsigned int ui = (unsigned int) wRateIdx;
while (ui > RATE_1M) {
- if (pDevice->basic_rates & ((u32)0x1 << ui))
+ if (priv->basic_rates & ((u32)0x1 << ui))
return (unsigned short)ui;
ui--;
@@ -628,28 +628,28 @@ static unsigned short CARDwGetCCKControlRate(struct vnt_private *pDevice,
*
* Parameters:
* In:
- * pDevice - The adapter to be set
+ * priv - The adapter to be set
* wRateIdx - Receiving data rate
* Out:
* none
*
* Return Value: response Control frame rate
*/
-static unsigned short CARDwGetOFDMControlRate(struct vnt_private *pDevice,
+static unsigned short CARDwGetOFDMControlRate(struct vnt_private *priv,
unsigned short wRateIdx)
{
unsigned int ui = (unsigned int) wRateIdx;
- pr_debug("BASIC RATE: %X\n", pDevice->basic_rates);
+ pr_debug("BASIC RATE: %X\n", priv->basic_rates);
- if (!CARDbIsOFDMinBasicRate((void *)pDevice)) {
+ if (!CARDbIsOFDMinBasicRate((void *)priv)) {
pr_debug("CARDwGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx);
if (wRateIdx > RATE_24M)
wRateIdx = RATE_24M;
return wRateIdx;
}
while (ui > RATE_11M) {
- if (pDevice->basic_rates & ((u32)0x1 << ui)) {
+ if (priv->basic_rates & ((u32)0x1 << ui)) {
pr_debug("CARDwGetOFDMControlRate : %d\n", ui);
return (unsigned short)ui;
}
@@ -664,162 +664,162 @@ static unsigned short CARDwGetOFDMControlRate(struct vnt_private *pDevice,
*
* Parameters:
* In:
- * pDevice - The adapter to be set
+ * priv - The adapter to be set
* Out:
* none
*
* Return Value: None.
*/
-void CARDvSetRSPINF(struct vnt_private *pDevice, u8 bb_type)
+void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type)
{
union vnt_phy_field_swap phy;
unsigned char byTxRate, byRsvTime; /* For OFDM */
unsigned long flags;
- spin_lock_irqsave(&pDevice->lock, flags);
+ spin_lock_irqsave(&priv->lock, flags);
/* Set to Page1 */
- MACvSelectPage1(pDevice->PortOffset);
+ MACvSelectPage1(priv->PortOffset);
/* RSPINF_b_1 */
- vnt_get_phy_field(pDevice, 14,
- CARDwGetCCKControlRate(pDevice, RATE_1M),
+ vnt_get_phy_field(priv, 14,
+ CARDwGetCCKControlRate(priv, RATE_1M),
PK_TYPE_11B, &phy.field_read);
/* swap over to get correct write order */
swap(phy.swap[0], phy.swap[1]);
- VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_1, phy.field_write);
+ VNSvOutPortD(priv->PortOffset + MAC_REG_RSPINF_B_1, phy.field_write);
/* RSPINF_b_2 */
- vnt_get_phy_field(pDevice, 14,
- CARDwGetCCKControlRate(pDevice, RATE_2M),
+ vnt_get_phy_field(priv, 14,
+ CARDwGetCCKControlRate(priv, RATE_2M),
PK_TYPE_11B, &phy.field_read);
swap(phy.swap[0], phy.swap[1]);
- VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_2, phy.field_write);
+ VNSvOutPortD(priv->PortOffset + MAC_REG_RSPINF_B_2, phy.field_write);
/* RSPINF_b_5 */
- vnt_get_phy_field(pDevice, 14,
- CARDwGetCCKControlRate(pDevice, RATE_5M),
+ vnt_get_phy_field(priv, 14,
+ CARDwGetCCKControlRate(priv, RATE_5M),
PK_TYPE_11B, &phy.field_read);
swap(phy.swap[0], phy.swap[1]);
- VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_5, phy.field_write);
+ VNSvOutPortD(priv->PortOffset + MAC_REG_RSPINF_B_5, phy.field_write);
/* RSPINF_b_11 */
- vnt_get_phy_field(pDevice, 14,
- CARDwGetCCKControlRate(pDevice, RATE_11M),
+ vnt_get_phy_field(priv, 14,
+ CARDwGetCCKControlRate(priv, RATE_11M),
PK_TYPE_11B, &phy.field_read);
swap(phy.swap[0], phy.swap[1]);
- VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_11, phy.field_write);
+ VNSvOutPortD(priv->PortOffset + MAC_REG_RSPINF_B_11, phy.field_write);
/* RSPINF_a_6 */
s_vCalculateOFDMRParameter(RATE_6M,
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_6, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_6, MAKEWORD(byTxRate, byRsvTime));
/* RSPINF_a_9 */
s_vCalculateOFDMRParameter(RATE_9M,
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_9, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_9, MAKEWORD(byTxRate, byRsvTime));
/* RSPINF_a_12 */
s_vCalculateOFDMRParameter(RATE_12M,
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_12, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_12, MAKEWORD(byTxRate, byRsvTime));
/* RSPINF_a_18 */
s_vCalculateOFDMRParameter(RATE_18M,
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_18, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_18, MAKEWORD(byTxRate, byRsvTime));
/* RSPINF_a_24 */
s_vCalculateOFDMRParameter(RATE_24M,
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_24, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_24, MAKEWORD(byTxRate, byRsvTime));
/* RSPINF_a_36 */
- s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)pDevice, RATE_36M),
+ s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)priv, RATE_36M),
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_36, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_36, MAKEWORD(byTxRate, byRsvTime));
/* RSPINF_a_48 */
- s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)pDevice, RATE_48M),
+ s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)priv, RATE_48M),
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_48, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_48, MAKEWORD(byTxRate, byRsvTime));
/* RSPINF_a_54 */
- s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)pDevice, RATE_54M),
+ s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)priv, RATE_54M),
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_54, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_54, MAKEWORD(byTxRate, byRsvTime));
/* RSPINF_a_72 */
- s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)pDevice, RATE_54M),
+ s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)priv, RATE_54M),
bb_type,
&byTxRate,
&byRsvTime);
- VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_72, MAKEWORD(byTxRate, byRsvTime));
+ VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_72, MAKEWORD(byTxRate, byRsvTime));
/* Set to Page0 */
- MACvSelectPage0(pDevice->PortOffset);
+ MACvSelectPage0(priv->PortOffset);
- spin_unlock_irqrestore(&pDevice->lock, flags);
+ spin_unlock_irqrestore(&priv->lock, flags);
}
-void CARDvUpdateBasicTopRate(struct vnt_private *pDevice)
+void CARDvUpdateBasicTopRate(struct vnt_private *priv)
{
unsigned char byTopOFDM = RATE_24M, byTopCCK = RATE_1M;
unsigned char ii;
/* Determines the highest basic rate. */
for (ii = RATE_54M; ii >= RATE_6M; ii--) {
- if ((pDevice->basic_rates) & ((u32)(1 << ii))) {
+ if ((priv->basic_rates) & ((u32)(1 << ii))) {
byTopOFDM = ii;
break;
}
}
- pDevice->byTopOFDMBasicRate = byTopOFDM;
+ priv->byTopOFDMBasicRate = byTopOFDM;
for (ii = RATE_11M;; ii--) {
- if ((pDevice->basic_rates) & ((u32)(1 << ii))) {
+ if ((priv->basic_rates) & ((u32)(1 << ii))) {
byTopCCK = ii;
break;
}
if (ii == RATE_1M)
break;
}
- pDevice->byTopCCKBasicRate = byTopCCK;
+ priv->byTopCCKBasicRate = byTopCCK;
}
-bool CARDbIsOFDMinBasicRate(struct vnt_private *pDevice)
+bool CARDbIsOFDMinBasicRate(struct vnt_private *priv)
{
int ii;
for (ii = RATE_54M; ii >= RATE_6M; ii--) {
- if ((pDevice->basic_rates) & ((u32)BIT(ii)))
+ if ((priv->basic_rates) & ((u32)BIT(ii)))
return true;
}
return false;
}
-unsigned char CARDbyGetPktType(struct vnt_private *pDevice)
+unsigned char CARDbyGetPktType(struct vnt_private *priv)
{
- if (pDevice->byBBType == BB_TYPE_11A || pDevice->byBBType == BB_TYPE_11B)
- return (unsigned char)pDevice->byBBType;
- else if (CARDbIsOFDMinBasicRate((void *)pDevice))
+ if (priv->byBBType == BB_TYPE_11A || priv->byBBType == BB_TYPE_11B)
+ return (unsigned char)priv->byBBType;
+ else if (CARDbIsOFDMinBasicRate((void *)priv))
return PK_TYPE_11GA;
else
return PK_TYPE_11GB;
@@ -830,7 +830,7 @@ unsigned char CARDbyGetPktType(struct vnt_private *pDevice)
*
* Parameters:
* In:
- * pDevice - The adapter to be set
+ * priv - The adapter to be set
* wLoopbackMode - Loopback mode to be set
* Out:
* none
@@ -859,17 +859,17 @@ void CARDvSetLoopbackMode(struct vnt_private *priv, unsigned short wLoopbackMode
*
* Parameters:
* In:
- * pDevice - The adapter to be reset
+ * priv - The adapter to be reset
* Out:
* none
*
* Return Value: none
*/
-bool CARDbSoftwareReset(struct vnt_private *pDevice)
+bool CARDbSoftwareReset(struct vnt_private *priv)
{
/* reset MAC */
- if (!MACbSafeSoftwareReset(pDevice->PortOffset))
+ if (!MACbSafeSoftwareReset(priv->PortOffset))
return false;
return true;
@@ -881,7 +881,7 @@ bool CARDbSoftwareReset(struct vnt_private *pDevice)
*
* Parameters:
* In:
- * pDevice - The adapter to be sync.
+ * priv - The adapter to be sync.
* qwTSF1 - Rx BCN's TSF
* qwTSF2 - Local TSF
* Out:
@@ -909,7 +909,7 @@ u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2)
*
* Parameters:
* In:
- * pDevice - The adapter to be read
+ * priv - The adapter to be read
* Out:
* qwCurrTSF - Current TSF counter
*
@@ -995,7 +995,7 @@ void CARDvSetFirstNextTBTT(struct vnt_private *priv, unsigned short wBeaconInter
*
* Parameters:
* In:
- * pDevice - The adapter to be set
+ * priv - The adapter to be set
* qwTSF - Current TSF counter
* wBeaconInterval - Beacon Interval
* Out:
--
2.5.0
Since this only contains one function and only used twice
remove inline altogether.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device.h | 5 -----
drivers/staging/vt6655/device_main.c | 4 ++--
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index aca6e00..0002049 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -306,11 +306,6 @@ struct vnt_private {
struct ieee80211_low_level_stats low_stats;
};
-static inline struct vnt_rd_info *alloc_rd_info(void)
-{
- return kzalloc(sizeof(struct vnt_rd_info), GFP_ATOMIC);
-}
-
static inline struct vnt_td_info *alloc_td_info(void)
{
return kzalloc(sizeof(struct vnt_td_info), GFP_ATOMIC);
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 8bca3fc..aa8f750 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -551,7 +551,7 @@ static void device_init_rd0_ring(struct vnt_private *priv)
for (i = 0; i < priv->sOpts.rx_descs0;
i ++, curr += sizeof(struct vnt_rx_desc)) {
desc = &priv->aRD0Ring[i];
- desc->rd_info = alloc_rd_info();
+ desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_ATOMIC);
if (!device_alloc_rx_buf(priv, desc))
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
@@ -575,7 +575,7 @@ static void device_init_rd1_ring(struct vnt_private *priv)
for (i = 0; i < priv->sOpts.rx_descs1;
i ++, curr += sizeof(struct vnt_rx_desc)) {
desc = &priv->aRD1Ring[i];
- desc->rd_info = alloc_rd_info();
+ desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_ATOMIC);
if (!device_alloc_rx_buf(priv, desc))
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
--
2.5.0
Most of these headers rate to old api that are no longer used
in driver.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device.h | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 4b8573b..be6c42b 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -31,34 +31,12 @@
#include <linux/module.h>
#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/errno.h>
-#include <linux/ioport.h>
#include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#include <linux/delay.h>
-#include <linux/timer.h>
-#include <linux/slab.h>
#include <linux/interrupt.h>
-#include <linux/string.h>
-#include <linux/wait.h>
-#include <linux/if_arp.h>
-#include <linux/sched.h>
-#include <linux/io.h>
-#include <linux/if.h>
#include <linux/crc32.h>
-#include <linux/uaccess.h>
-#include <linux/proc_fs.h>
-#include <linux/inetdevice.h>
-#include <linux/reboot.h>
-#include <linux/ethtool.h>
-/* Include Wireless Extension definition and check version - Jean II */
#include <net/mac80211.h>
-#include <linux/wireless.h>
-#include <net/iw_handler.h> /* New driver API */
/* device specific */
--
2.5.0
Covert values to macros.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index be6c42b..83bb68b 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -98,10 +98,8 @@
#define PK_TYPE_11GB 2
#define PK_TYPE_11GA 3
-typedef enum {
- OWNED_BY_HOST = 0,
- OWNED_BY_NIC = 1
-} DEVICE_OWNER_TYPE, *PDEVICE_OWNER_TYPE;
+#define OWNED_BY_HOST 0
+#define OWNED_BY_NIC 1
typedef struct __device_opt {
int nRxDescs0; /* Number of RX descriptors0 */
--
2.5.0