diff options
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m.h | 6 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/tx.c | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index b8c7dbfead49..1babc55b1312 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h | |||
@@ -242,6 +242,11 @@ struct i2400m_barker_db; | |||
242 | * so we have a tx_blk_size variable that the bus layer sets to | 242 | * so we have a tx_blk_size variable that the bus layer sets to |
243 | * tell the engine how much of that we need. | 243 | * tell the engine how much of that we need. |
244 | * | 244 | * |
245 | * @bus_tx_room_min: [fill] Minimum room required while allocating | ||
246 | * TX queue's buffer space for message header. SDIO requires | ||
247 | * 224 bytes and USB 16 bytes. Refer bus specific driver code | ||
248 | * for details. | ||
249 | * | ||
245 | * @bus_pl_size_max: [fill] Maximum payload size. | 250 | * @bus_pl_size_max: [fill] Maximum payload size. |
246 | * | 251 | * |
247 | * @bus_setup: [optional fill] Function called by the bus-generic code | 252 | * @bus_setup: [optional fill] Function called by the bus-generic code |
@@ -573,6 +578,7 @@ struct i2400m { | |||
573 | wait_queue_head_t state_wq; /* Woken up when on state updates */ | 578 | wait_queue_head_t state_wq; /* Woken up when on state updates */ |
574 | 579 | ||
575 | size_t bus_tx_block_size; | 580 | size_t bus_tx_block_size; |
581 | size_t bus_tx_room_min; | ||
576 | size_t bus_pl_size_max; | 582 | size_t bus_pl_size_max; |
577 | unsigned bus_bm_retries; | 583 | unsigned bus_bm_retries; |
578 | 584 | ||
diff --git a/drivers/net/wimax/i2400m/tx.c b/drivers/net/wimax/i2400m/tx.c index 609f1ca6e9fc..3f819efc06b5 100644 --- a/drivers/net/wimax/i2400m/tx.c +++ b/drivers/net/wimax/i2400m/tx.c | |||
@@ -563,8 +563,17 @@ void i2400m_tx_new(struct i2400m *i2400m) | |||
563 | struct i2400m_msg_hdr *tx_msg; | 563 | struct i2400m_msg_hdr *tx_msg; |
564 | bool try_head = 0; | 564 | bool try_head = 0; |
565 | BUG_ON(i2400m->tx_msg != NULL); | 565 | BUG_ON(i2400m->tx_msg != NULL); |
566 | /* | ||
567 | * In certain situations, TX queue might have enough space to | ||
568 | * accommodate the new message header I2400M_TX_PLD_SIZE, but | ||
569 | * might not have enough space to accommodate the payloads. | ||
570 | * Adding bus_tx_room_min padding while allocating a new TX message | ||
571 | * increases the possibilities of including at least one payload of the | ||
572 | * size <= bus_tx_room_min. | ||
573 | */ | ||
566 | try_head: | 574 | try_head: |
567 | tx_msg = i2400m_tx_fifo_push(i2400m, I2400M_TX_PLD_SIZE, 0, try_head); | 575 | tx_msg = i2400m_tx_fifo_push(i2400m, I2400M_TX_PLD_SIZE, |
576 | i2400m->bus_tx_room_min, try_head); | ||
568 | if (tx_msg == NULL) | 577 | if (tx_msg == NULL) |
569 | goto out; | 578 | goto out; |
570 | else if (tx_msg == TAIL_FULL) { | 579 | else if (tx_msg == TAIL_FULL) { |