Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134244
b: refs/heads/master
c: 59606ff
h: refs/heads/master
v: v3
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Jan 29, 2009
1 parent 50d04a3 commit a1099f4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77fecfb88f8ad64420e06a96f1bd3b38498bfb4f
refs/heads/master: 59606ffa9146538b73bbe1ca1285321cd7474bc0
7 changes: 4 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,11 @@ int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
{
int count;
struct iwl_queue *q;
struct iwl3945_tfd *tfd;
struct iwl3945_tfd *tfd, *tfd_tmp;

q = &txq->q;
tfd = &txq->tfds39[q->write_ptr];
tfd_tmp = (struct iwl3945_tfd *)txq->tfds;
tfd = &tfd_tmp[q->write_ptr];

if (reset)
memset(tfd, 0, sizeof(*tfd));
Expand Down Expand Up @@ -764,7 +765,7 @@ int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
*/
void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
{
struct iwl3945_tfd *tfd_tmp = (struct iwl3945_tfd *)&txq->tfds39[0];
struct iwl3945_tfd *tfd_tmp = (struct iwl3945_tfd *)txq->tfds;
struct iwl3945_tfd *tfd = &tfd_tmp[txq->q.read_ptr];
struct pci_dev *dev = priv->pci_dev;
int i;
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ static inline u8 iwl_tfd_get_num_tbs(struct iwl_tfd *tfd)
*/
void iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
{
struct iwl_tfd *tfd_tmp = (struct iwl_tfd *)&txq->tfds[0];
struct iwl_tfd *tfd_tmp = (struct iwl_tfd *)txq->tfds;
struct iwl_tfd *tfd;
struct pci_dev *dev = priv->pci_dev;
int index = txq->q.read_ptr;
Expand Down Expand Up @@ -563,11 +563,12 @@ int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
u8 reset, u8 pad)
{
struct iwl_queue *q;
struct iwl_tfd *tfd;
struct iwl_tfd *tfd, *tfd_tmp;
u32 num_tbs;

q = &txq->q;
tfd = &txq->tfds[q->write_ptr];
tfd_tmp = (struct iwl_tfd *)txq->tfds;
tfd = &tfd_tmp[q->write_ptr];

if (reset)
memset(tfd, 0, sizeof(*tfd));
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ struct iwl_tx_info {

struct iwl_tx_queue {
struct iwl_queue q;
struct iwl_tfd *tfds;
struct iwl3945_tfd *tfds39;
void *tfds;
struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS];
struct iwl_tx_info *txb;
u8 need_update;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,12 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv,
/* Circular buffer of transmit frame descriptors (TFDs),
* shared with device */
txq->tfds = pci_alloc_consistent(dev,
sizeof(txq->tfds[0]) * TFD_QUEUE_SIZE_MAX,
sizeof(struct iwl_tfd) * TFD_QUEUE_SIZE_MAX,
&txq->q.dma_addr);

if (!txq->tfds) {
IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n",
sizeof(txq->tfds[0]) * TFD_QUEUE_SIZE_MAX);
sizeof(struct iwl_tfd) * TFD_QUEUE_SIZE_MAX);
goto error;
}
txq->q.id = id;
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ static int iwl3945_tx_queue_alloc(struct iwl_priv *priv,

/* Circular buffer of transmit frame descriptors (TFDs),
* shared with device */
txq->tfds39 = pci_alloc_consistent(dev,
sizeof(txq->tfds39[0]) * TFD_QUEUE_SIZE_MAX,
&txq->q.dma_addr);
txq->tfds = pci_alloc_consistent(dev,
sizeof(struct iwl3945_tfd) * TFD_QUEUE_SIZE_MAX,
&txq->q.dma_addr);

if (!txq->tfds39) {
if (!txq->tfds) {
IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n",
sizeof(txq->tfds39[0]) * TFD_QUEUE_SIZE_MAX);
sizeof(struct iwl3945_tfd) * TFD_QUEUE_SIZE_MAX);
goto error;
}
txq->q.id = id;
Expand Down Expand Up @@ -287,7 +287,7 @@ void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq)
/* De-alloc circular buffer of TFDs */
if (txq->q.n_bd)
pci_free_consistent(dev, sizeof(struct iwl3945_tfd) *
txq->q.n_bd, txq->tfds39, txq->q.dma_addr);
txq->q.n_bd, txq->tfds, txq->q.dma_addr);

/* De-alloc array of per-TFD driver data */
kfree(txq->txb);
Expand Down

0 comments on commit a1099f4

Please sign in to comment.