aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregor kowski <gregor.kowski@gmail.com>2009-08-04 18:44:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:12:40 -0400
commitc45fa8c50c2149eec260a55c84e76339a2a761dd (patch)
tree62ccf4296c0f985f98870b2ccaff32bc707c98e8
parent7c81e98a60cc525e21a6d86cb4357a626f530699 (diff)
b43: remove wrong probe_resp_plcp write
The tkip hw support uncovered a bug in b43_write_probe_resp_template : it is writing at the wrong shm offset, it is in the B43_SHM_SH_TKIPTSCTTAK zone. Remove b43_write_probe_resp_template, b43_write_probe_resp_plcp and b43_write_probe_resp_plcp because the probe response offload is currently not supported by mac80211. Signed-off-by: Gregor Kowski <gregor.kowski@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43/main.c114
1 files changed, 0 insertions, 114 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 925f346ea361..997dd55b63f7 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1429,116 +1429,6 @@ static void b43_write_beacon_template(struct b43_wldev *dev,
1429 b43dbg(dev->wl, "Updated beacon template at 0x%x\n", ram_offset); 1429 b43dbg(dev->wl, "Updated beacon template at 0x%x\n", ram_offset);
1430} 1430}
1431 1431
1432static void b43_write_probe_resp_plcp(struct b43_wldev *dev,
1433 u16 shm_offset, u16 size,
1434 struct ieee80211_rate *rate)
1435{
1436 struct b43_plcp_hdr4 plcp;
1437 u32 tmp;
1438 __le16 dur;
1439
1440 plcp.data = 0;
1441 b43_generate_plcp_hdr(&plcp, size + FCS_LEN, rate->hw_value);
1442 dur = ieee80211_generic_frame_duration(dev->wl->hw,
1443 dev->wl->vif, size,
1444 rate);
1445 /* Write PLCP in two parts and timing for packet transfer */
1446 tmp = le32_to_cpu(plcp.data);
1447 b43_shm_write16(dev, B43_SHM_SHARED, shm_offset, tmp & 0xFFFF);
1448 b43_shm_write16(dev, B43_SHM_SHARED, shm_offset + 2, tmp >> 16);
1449 b43_shm_write16(dev, B43_SHM_SHARED, shm_offset + 6, le16_to_cpu(dur));
1450}
1451
1452/* Instead of using custom probe response template, this function
1453 * just patches custom beacon template by:
1454 * 1) Changing packet type
1455 * 2) Patching duration field
1456 * 3) Stripping TIM
1457 */
1458static const u8 *b43_generate_probe_resp(struct b43_wldev *dev,
1459 u16 *dest_size,
1460 struct ieee80211_rate *rate)
1461{
1462 const u8 *src_data;
1463 u8 *dest_data;
1464 u16 src_size, elem_size, src_pos, dest_pos;
1465 __le16 dur;
1466 struct ieee80211_hdr *hdr;
1467 size_t ie_start;
1468
1469 src_size = dev->wl->current_beacon->len;
1470 src_data = (const u8 *)dev->wl->current_beacon->data;
1471
1472 /* Get the start offset of the variable IEs in the packet. */
1473 ie_start = offsetof(struct ieee80211_mgmt, u.probe_resp.variable);
1474 B43_WARN_ON(ie_start != offsetof(struct ieee80211_mgmt, u.beacon.variable));
1475
1476 if (B43_WARN_ON(src_size < ie_start))
1477 return NULL;
1478
1479 dest_data = kmalloc(src_size, GFP_ATOMIC);
1480 if (unlikely(!dest_data))
1481 return NULL;
1482
1483 /* Copy the static data and all Information Elements, except the TIM. */
1484 memcpy(dest_data, src_data, ie_start);
1485 src_pos = ie_start;
1486 dest_pos = ie_start;
1487 for ( ; src_pos < src_size - 2; src_pos += elem_size) {
1488 elem_size = src_data[src_pos + 1] + 2;
1489 if (src_data[src_pos] == 5) {
1490 /* This is the TIM. */
1491 continue;
1492 }
1493 memcpy(dest_data + dest_pos, src_data + src_pos,
1494 elem_size);
1495 dest_pos += elem_size;
1496 }
1497 *dest_size = dest_pos;
1498 hdr = (struct ieee80211_hdr *)dest_data;
1499
1500 /* Set the frame control. */
1501 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
1502 IEEE80211_STYPE_PROBE_RESP);
1503 dur = ieee80211_generic_frame_duration(dev->wl->hw,
1504 dev->wl->vif, *dest_size,
1505 rate);
1506 hdr->duration_id = dur;
1507
1508 return dest_data;
1509}
1510
1511static void b43_write_probe_resp_template(struct b43_wldev *dev,
1512 u16 ram_offset,
1513 u16 shm_size_offset,
1514 struct ieee80211_rate *rate)
1515{
1516 const u8 *probe_resp_data;
1517 u16 size;
1518
1519 size = dev->wl->current_beacon->len;
1520 probe_resp_data = b43_generate_probe_resp(dev, &size, rate);
1521 if (unlikely(!probe_resp_data))
1522 return;
1523
1524 /* Looks like PLCP headers plus packet timings are stored for
1525 * all possible basic rates
1526 */
1527 /* FIXME this is the wrong offset : it goes in tkip rx phase1 shm */
1528#if 0
1529 b43_write_probe_resp_plcp(dev, 0x31A, size, &b43_b_ratetable[0]);
1530 b43_write_probe_resp_plcp(dev, 0x32C, size, &b43_b_ratetable[1]);
1531 b43_write_probe_resp_plcp(dev, 0x33E, size, &b43_b_ratetable[2]);
1532 b43_write_probe_resp_plcp(dev, 0x350, size, &b43_b_ratetable[3]);
1533#endif
1534
1535 size = min((size_t) size, 0x200 - sizeof(struct b43_plcp_hdr6));
1536 b43_write_template_common(dev, probe_resp_data,
1537 size, ram_offset, shm_size_offset,
1538 rate->hw_value);
1539 kfree(probe_resp_data);
1540}
1541
1542static void b43_upload_beacon0(struct b43_wldev *dev) 1432static void b43_upload_beacon0(struct b43_wldev *dev)
1543{ 1433{
1544 struct b43_wl *wl = dev->wl; 1434 struct b43_wl *wl = dev->wl;
@@ -1546,10 +1436,6 @@ static void b43_upload_beacon0(struct b43_wldev *dev)
1546 if (wl->beacon0_uploaded) 1436 if (wl->beacon0_uploaded)
1547 return; 1437 return;
1548 b43_write_beacon_template(dev, 0x68, 0x18); 1438 b43_write_beacon_template(dev, 0x68, 0x18);
1549 /* FIXME: Probe resp upload doesn't really belong here,
1550 * but we don't use that feature anyway. */
1551 b43_write_probe_resp_template(dev, 0x268, 0x4A,
1552 &__b43_ratetable[3]);
1553 wl->beacon0_uploaded = 1; 1439 wl->beacon0_uploaded = 1;
1554} 1440}
1555 1441