aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax/i2400m/control.c
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-02-28 18:42:54 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-02 06:10:28 -0500
commitc747583d19d5d5147a9f0eae480c1fdbc84c4252 (patch)
treee0af269356987f4096eb44b659bb874431264294 /drivers/net/wimax/i2400m/control.c
parent61b8d2688a0cc9434b18144342c719f809691d72 (diff)
wimax/i2400m: implement RX reorder support
Allow the device to give the driver RX data with reorder information. When that is done, the device will indicate the driver if a packet has to be held in a (sorted) queue. It will also tell the driver when held packets have to be released to the OS. This is done to improve the WiMAX-protocol level retransmission support when missing frames are detected. The code docs provide details about the implementation. In general, this just hooks into the RX path in rx.c; if a packet with the reorder bit in the RX header is detected, the reorder information in the header is extracted and one of the four main reorder operations are executed. In one case (queue) no packet will be delivered to the networking stack, just queued, whereas in the others (reset, update_ws and queue_update_ws), queued packet might be delivered depending on the window start for the specific queue. The modifications to files other than rx.c are: - control.c: during device initialization, enable reordering support if the rx_reorder_disabled module parameter is not enabled - driver.c: expose a rx_reorder_disable module parameter and call i2400m_rx_setup/release() to initialize/shutdown RX reorder support. - i2400m.h: introduce members in 'struct i2400m' needed for implementing reorder support. - linux/i2400m.h: introduce TLVs, commands and constant definitions related to RX reorder Last but not least, the rx reorder code includes an small circular log where the last N reorder operations are recorded to be displayed in case of inconsistency. Otherwise diagnosing issues would be almost impossible. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wimax/i2400m/control.c')
-rw-r--r--drivers/net/wimax/i2400m/control.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wimax/i2400m/control.c b/drivers/net/wimax/i2400m/control.c
index 4073c3e93bd4..b3cadb626fe0 100644
--- a/drivers/net/wimax/i2400m/control.c
+++ b/drivers/net/wimax/i2400m/control.c
@@ -1312,10 +1312,12 @@ int i2400m_dev_initialize(struct i2400m *i2400m)
1312 struct i2400m_tlv_config_idle_parameters idle_params; 1312 struct i2400m_tlv_config_idle_parameters idle_params;
1313 struct i2400m_tlv_config_idle_timeout idle_timeout; 1313 struct i2400m_tlv_config_idle_timeout idle_timeout;
1314 struct i2400m_tlv_config_d2h_data_format df; 1314 struct i2400m_tlv_config_d2h_data_format df;
1315 struct i2400m_tlv_config_dl_host_reorder dlhr;
1315 const struct i2400m_tlv_hdr *args[9]; 1316 const struct i2400m_tlv_hdr *args[9];
1316 unsigned argc = 0; 1317 unsigned argc = 0;
1317 1318
1318 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); 1319 d_fnstart(3, dev, "(i2400m %p)\n", i2400m);
1320 /* Disable idle mode? (enabled by default) */
1319 if (i2400m_idle_mode_disabled) { 1321 if (i2400m_idle_mode_disabled) {
1320 if (i2400m_le_v1_3(i2400m)) { 1322 if (i2400m_le_v1_3(i2400m)) {
1321 idle_params.hdr.type = 1323 idle_params.hdr.type =
@@ -1335,12 +1337,24 @@ int i2400m_dev_initialize(struct i2400m *i2400m)
1335 } 1337 }
1336 } 1338 }
1337 if (i2400m_ge_v1_4(i2400m)) { 1339 if (i2400m_ge_v1_4(i2400m)) {
1340 /* Enable extended RX data format? */
1338 df.hdr.type = 1341 df.hdr.type =
1339 cpu_to_le16(I2400M_TLV_CONFIG_D2H_DATA_FORMAT); 1342 cpu_to_le16(I2400M_TLV_CONFIG_D2H_DATA_FORMAT);
1340 df.hdr.length = cpu_to_le16( 1343 df.hdr.length = cpu_to_le16(
1341 sizeof(df) - sizeof(df.hdr)); 1344 sizeof(df) - sizeof(df.hdr));
1342 df.format = 1; 1345 df.format = 1;
1343 args[argc++] = &df.hdr; 1346 args[argc++] = &df.hdr;
1347
1348 /* Enable RX data reordering?
1349 * (switch flipped in rx.c:i2400m_rx_setup() after fw upload) */
1350 if (i2400m->rx_reorder) {
1351 dlhr.hdr.type =
1352 cpu_to_le16(I2400M_TLV_CONFIG_DL_HOST_REORDER);
1353 dlhr.hdr.length = cpu_to_le16(
1354 sizeof(dlhr) - sizeof(dlhr.hdr));
1355 dlhr.reorder = 1;
1356 args[argc++] = &dlhr.hdr;
1357 }
1344 } 1358 }
1345 result = i2400m_set_init_config(i2400m, args, argc); 1359 result = i2400m_set_init_config(i2400m, args, argc);
1346 if (result < 0) 1360 if (result < 0)