diff options
| author | Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com> | 2010-04-08 19:24:28 -0400 |
|---|---|---|
| committer | Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | 2010-05-11 17:06:12 -0400 |
| commit | a40242f2cde38ccb04d4c35cad66aab3c047fa6a (patch) | |
| tree | d92b9bf7a6dac8e364c6384335ed39e33408933e | |
| parent | e6dd789af1823908ed3ccda26bf07faf5970bce1 (diff) | |
wimax/i2400m: limit the message size upto 16KiB [v1]
According to Intel Wimax i3200, i5x50 and i6x50 specification
documents, the maximum size of each TX message can be upto 16KiB.
This patch modifies the i2400m_tx() routine to check that the
message size does not exceed the 16KiB limit.
Please refer the documentation in the code for details.
Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
| -rw-r--r-- | drivers/net/wimax/i2400m/tx.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wimax/i2400m/tx.c b/drivers/net/wimax/i2400m/tx.c index b10c3b77c27e..a5002c8467c2 100644 --- a/drivers/net/wimax/i2400m/tx.c +++ b/drivers/net/wimax/i2400m/tx.c | |||
| @@ -283,6 +283,11 @@ enum { | |||
| 283 | + I2400M_TX_PLD_MAX * sizeof(struct i2400m_pld), | 283 | + I2400M_TX_PLD_MAX * sizeof(struct i2400m_pld), |
| 284 | I2400M_TX_SKIP = 0x80000000, | 284 | I2400M_TX_SKIP = 0x80000000, |
| 285 | /* | 285 | /* |
| 286 | * According to Intel Wimax i3200, i5x50 and i6x50 specification | ||
| 287 | * documents, the maximum size of each message can be up to 16KiB. | ||
| 288 | */ | ||
| 289 | I2400M_TX_MSG_SIZE = 16384, | ||
| 290 | /* | ||
| 286 | * 16 byte aligned MAX_MTU + 4 byte payload prefix. | 291 | * 16 byte aligned MAX_MTU + 4 byte payload prefix. |
| 287 | */ | 292 | */ |
| 288 | I2400M_MAX_MTU_ALIGN = 16, | 293 | I2400M_MAX_MTU_ALIGN = 16, |
| @@ -682,7 +687,13 @@ try_new: | |||
| 682 | } | 687 | } |
| 683 | if (i2400m->tx_msg == NULL) | 688 | if (i2400m->tx_msg == NULL) |
| 684 | goto error_tx_new; | 689 | goto error_tx_new; |
| 685 | if (i2400m->tx_msg->size + padded_len > I2400M_TX_BUF_SIZE / 2) { | 690 | /* |
| 691 | * Check if this skb will fit in the TX queue's current active | ||
| 692 | * TX message. The total message size must not exceed the maximum | ||
| 693 | * size of each message I2400M_TX_MSG_SIZE. If it exceeds, | ||
| 694 | * close the current message and push this skb into the new message. | ||
| 695 | */ | ||
| 696 | if (i2400m->tx_msg->size + padded_len > I2400M_TX_MSG_SIZE) { | ||
| 686 | d_printf(2, dev, "TX: message too big, going new\n"); | 697 | d_printf(2, dev, "TX: message too big, going new\n"); |
| 687 | i2400m_tx_close(i2400m); | 698 | i2400m_tx_close(i2400m); |
| 688 | i2400m_tx_new(i2400m); | 699 | i2400m_tx_new(i2400m); |
