]> git.baikalelectronics.ru Git - kernel.git/commit
wimax/i2400m: fix insufficient size of Tx buffer for 12 payload of 1400 MTU.
authorPrasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
Wed, 27 Jan 2010 02:44:45 +0000 (19:44 -0700)
committerInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Tue, 11 May 2010 21:03:52 +0000 (14:03 -0700)
commit3f0bac02085be79f6d2aff58dffdfbf83b39e1d4
tree15f97dda1d474fe08beb3013c7d51701e70e1531
parent4d71897e16a9215f3b2aaeb1b0800c7b8f19acdf
wimax/i2400m: fix insufficient size of Tx buffer for 12 payload of 1400 MTU.

This patch increases the Tx buffer size so as to accommodate 12 payloads
of 1408 (1400 MTU 16 bytes aligned). Currently Tx buffer is 32 KiB which
is insufficient to accommodate 12 payloads of 1408 size.
This patch
 - increases I2400M_TX_BUF_SIZE from 32KiB to 64KiB
 - Adds a BUILD_BUG_ON if the calculated buffer size based
   on the given MTU exceeds the I2400M_TX_BUF_SIZE.

Below is how we calculate the size of the Tx buffer.
Payload + 4 bytes prefix for each payload (1400 MTU 16 bytes boundary aligned)
= (1408 + sizeof(struct i2400m_pl_data_hdr)) * I2400M_TX_PLD_MAX
Adding 16 byte message header = + sizeof(struct i2400m_msg_hdr)
Aligning to 256 byte boundary
Total Tx buffer = (((((1408 + sizeof(struct i2400m_pl_data_hdr))
* I2400M_TX_PLD_MAX )+ sizeof(struct i2400m_msg_hdr))
/ 256) + 1) * 256 * 2

Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/tx.c