From 6b69651cf507984159548507d2cc265d98418ea7 Mon Sep 17 00:00:00 2001 From: "Prasanna S. Panchamukhi" Date: Thu, 8 Apr 2010 16:24:29 -0700 Subject: [PATCH] --- yaml --- r: 195113 b: refs/heads/master c: 718e94907d79e74bbc7cfdb3cda2266079c5e993 h: refs/heads/master i: 195111: 8a45be149de53e18433578fed75c0a55045e3f58 v: v3 --- [refs] | 2 +- trunk/drivers/net/wimax/i2400m/tx.c | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index ffe5e02ae3dc..37389d05c314 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a40242f2cde38ccb04d4c35cad66aab3c047fa6a +refs/heads/master: 718e94907d79e74bbc7cfdb3cda2266079c5e993 diff --git a/trunk/drivers/net/wimax/i2400m/tx.c b/trunk/drivers/net/wimax/i2400m/tx.c index a5002c8467c2..1725f2b022a2 100644 --- a/trunk/drivers/net/wimax/i2400m/tx.c +++ b/trunk/drivers/net/wimax/i2400m/tx.c @@ -287,19 +287,6 @@ enum { * documents, the maximum size of each message can be up to 16KiB. */ I2400M_TX_MSG_SIZE = 16384, - /* - * 16 byte aligned MAX_MTU + 4 byte payload prefix. - */ - I2400M_MAX_MTU_ALIGN = 16, - I2400M_TX_PDU_SIZE = I2400M_MAX_MTU % I2400M_MAX_MTU_ALIGN - + I2400M_MAX_MTU + sizeof(struct i2400m_pl_data_hdr), - /* - * 256 byte aligned toal size of 12 PDUs including msg header, - */ - I2400M_TX_PDU_ALIGN = 256, - I2400M_TX_PDU_TOTAL_SIZE = ((I2400M_TX_PDU_SIZE * I2400M_TX_PLD_MAX - + sizeof(struct i2400m_msg_hdr))/I2400M_TX_PDU_ALIGN + 1) - * I2400M_TX_PDU_ALIGN * 2, }; #define TAIL_FULL ((void *)~(unsigned long)NULL) @@ -915,8 +902,11 @@ int i2400m_tx_setup(struct i2400m *i2400m) goto error_kmalloc; } - /* Warn if the calculated buffer size exceeds I2400M_TX_BUF_SIZE. */ - BUILD_BUG_ON(I2400M_TX_PDU_TOTAL_SIZE > I2400M_TX_BUF_SIZE); + /* + * Fail the build if we can't fit at least two maximum size messages + * on the TX FIFO [one being delivered while one is constructed]. + */ + BUILD_BUG_ON(2 * I2400M_TX_MSG_SIZE > I2400M_TX_BUF_SIZE); spin_lock_irqsave(&i2400m->tx_lock, flags); i2400m->tx_sequence = 0; i2400m->tx_in = 0;