Commit ef324285 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (33 commits)
  Added support for usb ethernet (0x0fe6, 0x9700)
  r8169: fix RTL8168DP power off issue.
  r8169: correct settings of rtl8102e.
  r8169: fix incorrect args to oob notify.
  DM9000B: Fix PHY power for network down/up
  DM9000B: Fix reg_save after spin_lock in dm9000_timeout
  net_sched: long word align struct qdisc_skb_cb data
  sfc: lower stack usage in efx_ethtool_self_test
  bridge: Use IPv6 link-local address for multicast listener queries
  bridge: Fix MLD queries' ethernet source address
  bridge: Allow mcast snooping for transient link local addresses too
  ipv6: Add IPv6 multicast address flag defines
  bridge: Add missing ntohs()s for MLDv2 report parsing
  bridge: Fix IPv6 multicast snooping by correcting offset in MLDv2 report
  bridge: Fix IPv6 multicast snooping by storing correct protocol type
  p54pci: update receive dma buffers before and after processing
  fix cfg80211_wext_siwfreq lock ordering...
  rt2x00: Fix WPA TKIP Michael MIC failures.
  ath5k: Fix fast channel switching
  tcp: undo_retrans counter fixes
  ...
parents b5f7376e 518d020a
...@@ -41,6 +41,9 @@ static struct usb_device_id ath3k_table[] = { ...@@ -41,6 +41,9 @@ static struct usb_device_id ath3k_table[] = {
/* Atheros AR9285 Malbec with sflash firmware */ /* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03F0, 0x311D) }, { USB_DEVICE(0x03F0, 0x311D) },
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE02C) },
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
......
...@@ -105,6 +105,9 @@ static struct usb_device_id blacklist_table[] = { ...@@ -105,6 +105,9 @@ static struct usb_device_id blacklist_table[] = {
/* Atheros AR9285 Malbec with sflash firmware */ /* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
/* Broadcom BCM2035 */ /* Broadcom BCM2035 */
{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
...@@ -829,7 +832,7 @@ static void btusb_work(struct work_struct *work) ...@@ -829,7 +832,7 @@ static void btusb_work(struct work_struct *work)
if (hdev->conn_hash.sco_num > 0) { if (hdev->conn_hash.sco_num > 0) {
if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) { if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) {
err = usb_autopm_get_interface(data->isoc); err = usb_autopm_get_interface(data->isoc ? data->isoc : data->intf);
if (err < 0) { if (err < 0) {
clear_bit(BTUSB_ISOC_RUNNING, &data->flags); clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
usb_kill_anchored_urbs(&data->isoc_anchor); usb_kill_anchored_urbs(&data->isoc_anchor);
...@@ -858,7 +861,7 @@ static void btusb_work(struct work_struct *work) ...@@ -858,7 +861,7 @@ static void btusb_work(struct work_struct *work)
__set_isoc_interface(hdev, 0); __set_isoc_interface(hdev, 0);
if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags)) if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags))
usb_autopm_put_interface(data->isoc); usb_autopm_put_interface(data->isoc ? data->isoc : data->intf);
} }
} }
......
...@@ -802,10 +802,7 @@ dm9000_init_dm9000(struct net_device *dev) ...@@ -802,10 +802,7 @@ dm9000_init_dm9000(struct net_device *dev)
/* Checksum mode */ /* Checksum mode */
dm9000_set_rx_csum_unlocked(dev, db->rx_csum); dm9000_set_rx_csum_unlocked(dev, db->rx_csum);
/* GPIO0 on pre-activate PHY */
iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */
iow(db, DM9000_GPR, 0); /* Enable PHY */
ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;
...@@ -852,8 +849,8 @@ static void dm9000_timeout(struct net_device *dev) ...@@ -852,8 +849,8 @@ static void dm9000_timeout(struct net_device *dev)
unsigned long flags; unsigned long flags;
/* Save previous register address */ /* Save previous register address */
reg_save = readb(db->io_addr);
spin_lock_irqsave(&db->lock, flags); spin_lock_irqsave(&db->lock, flags);
reg_save = readb(db->io_addr);
netif_stop_queue(dev); netif_stop_queue(dev);
dm9000_reset(db); dm9000_reset(db);
...@@ -1194,6 +1191,10 @@ dm9000_open(struct net_device *dev) ...@@ -1194,6 +1191,10 @@ dm9000_open(struct net_device *dev)
if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev)) if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
return -EAGAIN; return -EAGAIN;
/* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
mdelay(1); /* delay needs by DM9000B */
/* Initialize DM9000 board */ /* Initialize DM9000 board */
dm9000_reset(db); dm9000_reset(db);
dm9000_init_dm9000(dev); dm9000_init_dm9000(dev);
......
...@@ -617,8 +617,9 @@ static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data) ...@@ -617,8 +617,9 @@ static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data)
} }
} }
static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd) static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
{ {
void __iomem *ioaddr = tp->mmio_addr;
int i; int i;
RTL_W8(ERIDR, cmd); RTL_W8(ERIDR, cmd);
...@@ -630,7 +631,7 @@ static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd) ...@@ -630,7 +631,7 @@ static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd)
break; break;
} }
ocp_write(ioaddr, 0x1, 0x30, 0x00000001); ocp_write(tp, 0x1, 0x30, 0x00000001);
} }
#define OOB_CMD_RESET 0x00 #define OOB_CMD_RESET 0x00
...@@ -2868,8 +2869,11 @@ static void r8168_pll_power_down(struct rtl8169_private *tp) ...@@ -2868,8 +2869,11 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
{ {
void __iomem *ioaddr = tp->mmio_addr; void __iomem *ioaddr = tp->mmio_addr;
if (tp->mac_version == RTL_GIGA_MAC_VER_27) if (((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
(tp->mac_version == RTL_GIGA_MAC_VER_28)) &&
(ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) {
return; return;
}
if (((tp->mac_version == RTL_GIGA_MAC_VER_23) || if (((tp->mac_version == RTL_GIGA_MAC_VER_23) ||
(tp->mac_version == RTL_GIGA_MAC_VER_24)) && (tp->mac_version == RTL_GIGA_MAC_VER_24)) &&
...@@ -2891,6 +2895,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp) ...@@ -2891,6 +2895,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_25: case RTL_GIGA_MAC_VER_25:
case RTL_GIGA_MAC_VER_26: case RTL_GIGA_MAC_VER_26:
case RTL_GIGA_MAC_VER_27:
case RTL_GIGA_MAC_VER_28:
RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80); RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
break; break;
} }
...@@ -2900,12 +2906,17 @@ static void r8168_pll_power_up(struct rtl8169_private *tp) ...@@ -2900,12 +2906,17 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
{ {
void __iomem *ioaddr = tp->mmio_addr; void __iomem *ioaddr = tp->mmio_addr;
if (tp->mac_version == RTL_GIGA_MAC_VER_27) if (((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
(tp->mac_version == RTL_GIGA_MAC_VER_28)) &&
(ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) {
return; return;
}
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_25: case RTL_GIGA_MAC_VER_25:
case RTL_GIGA_MAC_VER_26: case RTL_GIGA_MAC_VER_26:
case RTL_GIGA_MAC_VER_27:
case RTL_GIGA_MAC_VER_28:
RTL_W8(PMCH, RTL_R8(PMCH) | 0x80); RTL_W8(PMCH, RTL_R8(PMCH) | 0x80);
break; break;
} }
...@@ -3042,7 +3053,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3042,7 +3053,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_mwi_2; goto err_out_mwi_2;
} }
tp->cp_cmd = PCIMulRW | RxChkSum; tp->cp_cmd = RxChkSum;
if ((sizeof(dma_addr_t) > 4) && if ((sizeof(dma_addr_t) > 4) &&
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) { !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) {
...@@ -3318,7 +3329,8 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp) ...@@ -3318,7 +3329,8 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
/* Disable interrupts */ /* Disable interrupts */
rtl8169_irq_mask_and_ack(ioaddr); rtl8169_irq_mask_and_ack(ioaddr);
if (tp->mac_version == RTL_GIGA_MAC_VER_28) { if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
tp->mac_version == RTL_GIGA_MAC_VER_28) {
while (RTL_R8(TxPoll) & NPQ) while (RTL_R8(TxPoll) & NPQ)
udelay(20); udelay(20);
...@@ -3847,8 +3859,7 @@ static void rtl_hw_start_8168(struct net_device *dev) ...@@ -3847,8 +3859,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
Cxpl_dbg_sel | \ Cxpl_dbg_sel | \
ASF | \ ASF | \
PktCntrDisable | \ PktCntrDisable | \
PCIDAC | \ Mac_dbgo_sel)
PCIMulRW)
static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
{ {
...@@ -3878,8 +3889,6 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) ...@@ -3878,8 +3889,6 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
if ((cfg1 & LEDS0) && (cfg1 & LEDS1)) if ((cfg1 & LEDS0) && (cfg1 & LEDS1))
RTL_W8(Config1, cfg1 & ~LEDS0); RTL_W8(Config1, cfg1 & ~LEDS0);
RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1)); rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1));
} }
...@@ -3891,8 +3900,6 @@ static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev) ...@@ -3891,8 +3900,6 @@ static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev)
RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable); RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable);
RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
} }
static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev) static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev)
...@@ -3918,6 +3925,8 @@ static void rtl_hw_start_8101(struct net_device *dev) ...@@ -3918,6 +3925,8 @@ static void rtl_hw_start_8101(struct net_device *dev)
} }
} }
RTL_W8(Cfg9346, Cfg9346_Unlock);
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_07: case RTL_GIGA_MAC_VER_07:
rtl_hw_start_8102e_1(ioaddr, pdev); rtl_hw_start_8102e_1(ioaddr, pdev);
...@@ -3932,14 +3941,13 @@ static void rtl_hw_start_8101(struct net_device *dev) ...@@ -3932,14 +3941,13 @@ static void rtl_hw_start_8101(struct net_device *dev)
break; break;
} }
RTL_W8(Cfg9346, Cfg9346_Unlock); RTL_W8(Cfg9346, Cfg9346_Lock);
RTL_W8(MaxTxPacketSize, TxPacketMax); RTL_W8(MaxTxPacketSize, TxPacketMax);
rtl_set_rx_max_size(ioaddr, rx_buf_sz); rtl_set_rx_max_size(ioaddr, rx_buf_sz);
tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; tp->cp_cmd &= ~R810X_CPCMD_QUIRK_MASK;
RTL_W16(CPlusCmd, tp->cp_cmd); RTL_W16(CPlusCmd, tp->cp_cmd);
RTL_W16(IntrMitigate, 0x0000); RTL_W16(IntrMitigate, 0x0000);
...@@ -3949,14 +3957,10 @@ static void rtl_hw_start_8101(struct net_device *dev) ...@@ -3949,14 +3957,10 @@ static void rtl_hw_start_8101(struct net_device *dev)
RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
rtl_set_rx_tx_config_registers(tp); rtl_set_rx_tx_config_registers(tp);
RTL_W8(Cfg9346, Cfg9346_Lock);
RTL_R8(IntrMask); RTL_R8(IntrMask);
rtl_set_rx_mode(dev); rtl_set_rx_mode(dev);
RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000); RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000);
RTL_W16(IntrMask, tp->intr_event); RTL_W16(IntrMask, tp->intr_event);
......
...@@ -569,9 +569,14 @@ static void efx_ethtool_self_test(struct net_device *net_dev, ...@@ -569,9 +569,14 @@ static void efx_ethtool_self_test(struct net_device *net_dev,
struct ethtool_test *test, u64 *data) struct ethtool_test *test, u64 *data)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = netdev_priv(net_dev);
struct efx_self_tests efx_tests; struct efx_self_tests *efx_tests;
int already_up; int already_up;
int rc; int rc = -ENOMEM;
efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL);
if (!efx_tests)
goto fail;
ASSERT_RTNL(); ASSERT_RTNL();
if (efx->state != STATE_RUNNING) { if (efx->state != STATE_RUNNING) {
...@@ -589,13 +594,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev, ...@@ -589,13 +594,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev,
if (rc) { if (rc) {
netif_err(efx, drv, efx->net_dev, netif_err(efx, drv, efx->net_dev,
"failed opening device.\n"); "failed opening device.\n");
goto fail2; goto fail1;
} }
} }
memset(&efx_tests, 0, sizeof(efx_tests)); rc = efx_selftest(efx, efx_tests, test->flags);
rc = efx_selftest(efx, &efx_tests, test->flags);
if (!already_up) if (!already_up)
dev_close(efx->net_dev); dev_close(efx->net_dev);
...@@ -604,10 +607,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev, ...@@ -604,10 +607,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev,
rc == 0 ? "passed" : "failed", rc == 0 ? "passed" : "failed",
(test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on"); (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
fail2: fail1:
fail1:
/* Fill ethtool results structures */ /* Fill ethtool results structures */
efx_ethtool_fill_self_tests(efx, &efx_tests, NULL, data); efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data);
kfree(efx_tests);
fail:
if (rc) if (rc)
test->flags |= ETH_TEST_FL_FAILED; test->flags |= ETH_TEST_FL_FAILED;
} }
......
...@@ -650,6 +650,10 @@ static const struct usb_device_id products[] = { ...@@ -650,6 +650,10 @@ static const struct usb_device_id products[] = {
USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */ USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */
.driver_info = (unsigned long)&dm9601_info, .driver_info = (unsigned long)&dm9601_info,
}, },
{
USB_DEVICE(0x0fe6, 0x9700), /* DM9601 USB to Fast Ethernet Adapter */
.driver_info = (unsigned long)&dm9601_info,
},
{ {
USB_DEVICE(0x0a46, 0x9000), /* DM9000E */ USB_DEVICE(0x0a46, 0x9000), /* DM9000E */
.driver_info = (unsigned long)&dm9601_info, .driver_info = (unsigned long)&dm9601_info,
......
...@@ -282,6 +282,34 @@ int ath5k_hw_phy_disable(struct ath5k_hw *ah) ...@@ -282,6 +282,34 @@ int ath5k_hw_phy_disable(struct ath5k_hw *ah)
return 0; return 0;
} }
/*
* Wait for synth to settle
*/
static void ath5k_hw_wait_for_synth(struct ath5k_hw *ah,
struct ieee80211_channel *channel)
{
/*
* On 5211+ read activation -> rx delay
* and use it (100ns steps).
*/
if (ah->ah_version != AR5K_AR5210) {
u32 delay;
delay = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) &
AR5K_PHY_RX_DELAY_M;
delay = (channel->hw_value & CHANNEL_CCK) ?
((delay << 2) / 22) : (delay / 10);
if (ah->ah_bwmode == AR5K_BWMODE_10MHZ)
delay = delay << 1;
if (ah->ah_bwmode == AR5K_BWMODE_5MHZ)
delay = delay << 2;
/* XXX: /2 on turbo ? Let's be safe
* for now */
udelay(100 + delay);
} else {
mdelay(1);
}
}
/**********************\ /**********************\
* RF Gain optimization * * RF Gain optimization *
...@@ -1253,6 +1281,7 @@ static int ath5k_hw_channel(struct ath5k_hw *ah, ...@@ -1253,6 +1281,7 @@ static int ath5k_hw_channel(struct ath5k_hw *ah,
case AR5K_RF5111: case AR5K_RF5111:
ret = ath5k_hw_rf5111_channel(ah, channel); ret = ath5k_hw_rf5111_channel(ah, channel);
break; break;
case AR5K_RF2317:
case AR5K_RF2425: case AR5K_RF2425:
ret = ath5k_hw_rf2425_channel(ah, channel); ret = ath5k_hw_rf2425_channel(ah, channel);
break; break;
...@@ -3237,6 +3266,13 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3237,6 +3266,13 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
/* Failed */ /* Failed */
if (i >= 100) if (i >= 100)
return -EIO; return -EIO;
/* Set channel and wait for synth */
ret = ath5k_hw_channel(ah, channel);
if (ret)
return ret;
ath5k_hw_wait_for_synth(ah, channel);
} }
/* /*
...@@ -3251,13 +3287,53 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3251,13 +3287,53 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
if (ret) if (ret)
return ret; return ret;
/* Write OFDM timings on 5212*/
if (ah->ah_version == AR5K_AR5212 &&
channel->hw_value & CHANNEL_OFDM) {
ret = ath5k_hw_write_ofdm_timings(ah, channel);
if (ret)
return ret;
/* Spur info is available only from EEPROM versions
* greater than 5.3, but the EEPROM routines will use
* static values for older versions */
if (ah->ah_mac_srev >= AR5K_SREV_AR5424)
ath5k_hw_set_spur_mitigation_filter(ah,
channel);
}
/* If we used fast channel switching
* we are done, release RF bus and
* fire up NF calibration.
*
* Note: Only NF calibration due to
* channel change, not AGC calibration
* since AGC is still running !
*/
if (fast) {
/*
* Release RF Bus grant
*/
AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_RFBUS_REQ,
AR5K_PHY_RFBUS_REQ_REQUEST);
/*
* Start NF calibration
*/
AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL,
AR5K_PHY_AGCCTL_NF);
return ret;
}
/* /*
* For 5210 we do all initialization using * For 5210 we do all initialization using
* initvals, so we don't have to modify * initvals, so we don't have to modify
* any settings (5210 also only supports * any settings (5210 also only supports
* a/aturbo modes) * a/aturbo modes)
*/ */
if ((ah->ah_version != AR5K_AR5210) && !fast) { if (ah->ah_version != AR5K_AR5210) {
/* /*
* Write initial RF gain settings * Write initial RF gain settings
...@@ -3276,22 +3352,6 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3276,22 +3352,6 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
if (ret) if (ret)
return ret; return ret;
/* Write OFDM timings on 5212*/
if (ah->ah_version == AR5K_AR5212 &&
channel->hw_value & CHANNEL_OFDM) {
ret = ath5k_hw_write_ofdm_timings(ah, channel);
if (ret)
return ret;
/* Spur info is available only from EEPROM versions
* greater than 5.3, but the EEPROM routines will use
* static values for older versions */
if (ah->ah_mac_srev >= AR5K_SREV_AR5424)
ath5k_hw_set_spur_mitigation_filter(ah,
channel);
}
/*Enable/disable 802.11b mode on 5111 /*Enable/disable 802.11b mode on 5111
(enable 2111 frequency converter + CCK)*/ (enable 2111 frequency converter + CCK)*/
if (ah->ah_radio == AR5K_RF5111) { if (ah->ah_radio == AR5K_RF5111) {
...@@ -3322,47 +3382,20 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3322,47 +3382,20 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
*/ */
ath5k_hw_reg_write(ah, AR5K_PHY_ACT_ENABLE, AR5K_PHY_ACT); ath5k_hw_reg_write(ah, AR5K_PHY_ACT_ENABLE, AR5K_PHY_ACT);
ath5k_hw_wait_for_synth(ah, channel);
/* /*
* On 5211+ read activation -> rx delay * Perform ADC test to see if baseband is ready
* and use it. * Set tx hold and check adc test register
*/ */
if (ah->ah_version != AR5K_AR5210) { phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1);
u32 delay; ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1);
delay = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) & for (i = 0; i <= 20; i++) {
AR5K_PHY_RX_DELAY_M; if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10))
delay = (channel->hw_value & CHANNEL_CCK) ? break;
((delay << 2) / 22) : (delay / 10); udelay(200);
if (ah->ah_bwmode == AR5K_BWMODE_10MHZ)
delay = delay << 1;
if (ah->ah_bwmode == AR5K_BWMODE_5MHZ)
delay = delay << 2;
/* XXX: /2 on turbo ? Let's be safe
* for now */
udelay(100 + delay);
} else {
mdelay(1);
}
if (fast)
/*
* Release RF Bus grant
*/
AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_RFBUS_REQ,
AR5K_PHY_RFBUS_REQ_REQUEST);
else {
/*
* Perform ADC test to see if baseband is ready
* Set tx hold and check adc test register
*/
phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1);
ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1);
for (i = 0; i <= 20; i++) {
if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10))
break;
udelay(200);
}
ath5k_hw_reg_write(ah, phy_tst1, AR5K_PHY_TST1);
} }
ath5k_hw_reg_write(ah, phy_tst1, AR5K_PHY_TST1);
/* /*
* Start automatic gain control calibration * Start automatic gain control calibration
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/pm_qos_params.h>
#include "debug.h" #include "debug.h"
#include "common.h" #include "common.h"
...@@ -57,8 +56,6 @@ struct ath_node; ...@@ -57,8 +56,6 @@ struct ath_node;
#define A_MAX(a, b) ((a) > (b) ? (a) : (b)) #define A_MAX(a, b) ((a) > (b) ? (a) : (b))
#define ATH9K_PM_QOS_DEFAULT_VALUE 55
#define TSF_TO_TU(_h,_l) \ #define TSF_TO_TU(_h,_l) \
((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
...@@ -633,8 +630,6 @@ struct ath_softc { ...@@ -633,8 +630,6 @@ struct ath_softc {
struct ath_descdma txsdma; struct ath_descdma txsdma;
struct ath_ant_comb ant_comb; struct ath_ant_comb ant_comb;
struct pm_qos_request_list pm_qos_req;
}; };
struct ath_wiphy { struct ath_wiphy {
...@@ -666,7 +661,6 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) ...@@ -666,7 +661,6 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz)
extern struct ieee80211_ops ath9k_ops; extern struct ieee80211_ops ath9k_ops;
extern int ath9k_modparam_nohwcrypt; extern int ath9k_modparam_nohwcrypt;
extern int led_blink; extern int led_blink;
extern int ath9k_pm_qos_value;
extern bool is_ath9k_unloaded; extern bool is_ath9k_unloaded;
irqreturn_t ath_isr(int irq, void *dev); irqreturn_t ath_isr(int irq, void *dev);
......
...@@ -41,10 +41,6 @@ static int ath9k_btcoex_enable; ...@@ -41,10 +41,6 @@ static int ath9k_btcoex_enable;
module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444);
MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence");
int ath9k_pm_qos_value = ATH9K_PM_QOS_DEFAULT_VALUE;
module_param_named(pmqos, ath9k_pm_qos_value, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(pmqos, "User specified PM-QOS value");
bool is_ath9k_unloaded; bool is_ath9k_unloaded;
/* We use the hw_value as an index into our private channel structure */ /* We use the hw_value as an index into our private channel structure */
...@@ -762,9 +758,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, ...@@ -762,9 +758,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
ath_init_leds(sc); ath_init_leds(sc);
ath_start_rfkill_poll(sc); ath_start_rfkill_poll(sc);
pm_qos_add_request(&sc->pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
PM_QOS_DEFAULT_VALUE);
return 0; return 0;
error_world: error_world:
...@@ -831,7 +824,6 @@ void ath9k_deinit_device(struct ath_softc *sc) ...@@ -831,7 +824,6 @@ void ath9k_deinit_device(struct ath_softc *sc)
} }
ieee80211_unregister_hw(hw); ieee80211_unregister_hw(hw);
pm_qos_remove_request(&sc->pm_qos_req);
ath_rx_cleanup(sc); ath_rx_cleanup(sc);
ath_tx_cleanup(sc); ath_tx_cleanup(sc);
ath9k_deinit_softc(sc); ath9k_deinit_softc(sc);
......
...@@ -1173,12 +1173,6 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -1173,12 +1173,6 @@ static int ath9k_start(struct ieee80211_hw *hw)
ath9k_btcoex_timer_resume(sc); ath9k_btcoex_timer_resume(sc);
} }
/* User has the option to provide pm-qos value as a module
* parameter rather than using the default value of
* 'ATH9K_PM_QOS_DEFAULT_VALUE'.
*/
pm_qos_update_request(&sc->pm_qos_req, ath9k_pm_qos_value);
if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en) if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en)
common->bus_ops->extn_synch_en(common); common->bus_ops->extn_synch_en(common);
...@@ -1345,8 +1339,6 @@ static void ath9k_stop(struct ieee80211_hw *hw) ...@@ -1345,8 +1339,6 @@ static void ath9k_stop(struct ieee80211_hw *hw)
sc->sc_flags |= SC_OP_INVALID; sc->sc_flags |= SC_OP_INVALID;
pm_qos_update_request(&sc->pm_qos_req, PM_QOS_DEFAULT_VALUE);
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
ath_dbg(common, ATH_DBG_CONFIG, "Driver halt\n"); ath_dbg(common, ATH_DBG_CONFIG, "Driver halt\n");
......
...@@ -199,6 +199,7 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index, ...@@ -199,6 +199,7 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index,
while (i != idx) { while (i != idx) {
u16 len; u16 len;
struct sk_buff *skb; struct sk_buff *skb;
dma_addr_t dma_addr;
desc = &ring[i]; desc = &ring[i];
len = le16_to_cpu(desc->len); len = le16_to_cpu(desc->len);
skb = rx_buf[i]; skb = rx_buf[i];
...@@ -216,17 +217,20 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index, ...@@ -216,17 +217,20 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index,
len = priv->common.rx_mtu; len = priv->common.rx_mtu;
} }
dma_addr = le32_to_cpu(desc->host_addr);
pci_dma_sync_single_for_cpu(priv->pdev, dma_addr,
priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE);
skb_put(skb, len); skb_put(skb, len);
if (p54_rx(dev, skb)) { if (p54_rx(dev, skb)) {
pci_unmap_single(priv->pdev, pci_unmap_single(priv->pdev, dma_addr,
le32_to_cpu(desc->host_addr), priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE);
priv->common.rx_mtu + 32,
PCI_DMA_FROMDEVICE);
rx_buf[i] = NULL; rx_buf[i] = NULL;
desc->host_addr = 0; desc->host_addr = cpu_to_le32(0);
} else { } else {
skb_trim(skb, 0); skb_trim(skb, 0);
pci_dma_sync_single_for_device(priv->pdev, dma_addr,
priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE);
desc->len = cpu_to_le16(priv->common.rx_mtu + 32); desc->len = cpu_to_le16(priv->common.rx_mtu + 32);
} }
......
...@@ -652,6 +652,12 @@ static void rt2800pci_fill_rxdone(struct queue_entry *entry, ...@@ -652,6 +652,12 @@ static void rt2800pci_fill_rxdone(struct queue_entry *entry,
*/ */
rxdesc->flags |= RX_FLAG_IV_STRIPPED; rxdesc->flags |= RX_FLAG_IV_STRIPPED;
/*
* The hardware has already checked the Michael Mic and has
* stripped it from the frame. Signal this to mac80211.
*/
rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;
if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS)
rxdesc->flags |= RX_FLAG_DECRYPTED; rxdesc->flags |= RX_FLAG_DECRYPTED;
else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC)
...@@ -1065,6 +1071,8 @@ static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = { ...@@ -1065,6 +1071,8 @@ static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = {
{ PCI_DEVICE(0x1814, 0x3390), PCI_DEVICE_DATA(&rt2800pci_ops) }, { PCI_DEVICE(0x1814, 0x3390), PCI_DEVICE_DATA(&rt2800pci_ops) },
#endif #endif
#ifdef CONFIG_RT2800PCI_RT35XX #ifdef CONFIG_RT2800PCI_RT35XX
{ PCI_DEVICE(0x1432, 0x7711), PCI_DEVICE_DATA(&rt2800pci_ops) },
{ PCI_DEVICE(0x1432, 0x7722), PCI_DEVICE_DATA(&rt2800pci_ops) },
{ PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) }, { PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) },
{ PCI_DEVICE(0x1814, 0x3062), PCI_DEVICE_DATA(&rt2800pci_ops) }, { PCI_DEVICE(0x1814, 0x3062), PCI_DEVICE_DATA(&rt2800pci_ops) },
{ PCI_DEVICE(0x1814, 0x3562), PCI_DEVICE_DATA(&rt2800pci_ops) }, { PCI_DEVICE(0x1814, 0x3562), PCI_DEVICE_DATA(&rt2800pci_ops) },
......
...@@ -486,6 +486,12 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, ...@@ -486,6 +486,12 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry,
*/ */
rxdesc->flags |= RX_FLAG_IV_STRIPPED; rxdesc->flags |= RX_FLAG_IV_STRIPPED;
/*
* The hardware has already checked the Michael Mic and has
* stripped it from the frame. Signal this to mac80211.
*/
rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;
if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS)
rxdesc->flags |= RX_FLAG_DECRYPTED; rxdesc->flags |= RX_FLAG_DECRYPTED;
else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC)
......
...@@ -101,8 +101,8 @@ struct ieee_pfc { ...@@ -101,8 +101,8 @@ struct ieee_pfc {
*/ */
struct dcb_app { struct dcb_app {
__u8 selector; __u8 selector;
__u32 protocol;
__u8 priority; __u8 priority;
__u16 protocol;
}; };
struct dcbmsg { struct dcbmsg {
......
...@@ -88,6 +88,18 @@ ...@@ -88,6 +88,18 @@
#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 #define IPV6_ADDR_SCOPE_ORGLOCAL 0x08
#define IPV6_ADDR_SCOPE_GLOBAL 0x0e #define IPV6_ADDR_SCOPE_GLOBAL 0x0e
/*
* Addr flags
*/
#ifdef __KERNEL__
#define IPV6_ADDR_MC_FLAG_TRANSIENT(a) \
((a)->s6_addr[1] & 0x10)
#define IPV6_ADDR_MC_FLAG_PREFIX(a) \
((a)->s6_addr[1] & 0x20)
#define IPV6_ADDR_MC_FLAG_RENDEZVOUS(a) \
((a)->s6_addr[1] & 0x40)
#endif
/* /*
* fragmentation header * fragmentation header
*/ */
......
...@@ -201,18 +201,8 @@ nf_tproxy_get_sock_v6(struct net *net, const u8 protocol, ...@@ -201,18 +201,8 @@ nf_tproxy_get_sock_v6(struct net *net, const u8 protocol,
} }
#endif #endif
static inline void
nf_tproxy_put_sock(struct sock *sk)
{
/* TIME_WAIT inet sockets have to be handled differently */
if ((sk->sk_protocol == IPPROTO_TCP) && (sk->sk_state == TCP_TIME_WAIT))
inet_twsk_put(inet_twsk(sk));
else
sock_put(sk);
}
/* assign a socket to the skb -- consumes sk */ /* assign a socket to the skb -- consumes sk */
int void
nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk); nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk);
#endif #endif
...@@ -199,7 +199,7 @@ struct tcf_proto { ...@@ -199,7 +199,7 @@ struct tcf_proto {
struct qdisc_skb_cb { struct qdisc_skb_cb {
unsigned int pkt_len; unsigned int pkt_len;
char data[]; long data[];
}; };
static inline int qdisc_qlen(struct Qdisc *q) static inline int qdisc_qlen(struct Qdisc *q)
......
...@@ -727,7 +727,9 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp) ...@@ -727,7 +727,9 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)
break; break;
} }
tty_unlock();
schedule(); schedule();
tty_lock();
} }
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
remove_wait_queue(&dev->wait, &wait); remove_wait_queue(&dev->wait, &wait);
......
...@@ -37,10 +37,9 @@ ...@@ -37,10 +37,9 @@
rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock))
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static inline int ipv6_is_local_multicast(const struct in6_addr *addr) static inline int ipv6_is_transient_multicast(const struct in6_addr *addr)
{ {
if (ipv6_addr_is_multicast(addr) && if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr))
IPV6_ADDR_MC_SCOPE(addr) <= IPV6_ADDR_SCOPE_LINKLOCAL)
return 1; return 1;
return 0; return 0;
} }
...@@ -435,7 +434,6 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, ...@@ -435,7 +434,6 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
eth = eth_hdr(skb); eth = eth_hdr(skb);
memcpy(eth->h_source, br->dev->dev_addr, 6); memcpy(eth->h_source, br->dev->dev_addr, 6);
ipv6_eth_mc_map(group, eth->h_dest);
eth->h_proto = htons(ETH_P_IPV6); eth->h_proto = htons(ETH_P_IPV6);
skb_put(skb, sizeof(*eth)); skb_put(skb, sizeof(*eth));
...@@ -447,8 +445,10 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, ...@@ -447,8 +445,10 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
ip6h->payload_len = htons(8 + sizeof(*mldq)); ip6h->payload_len = htons(8 + sizeof(*mldq));
ip6h->nexthdr = IPPROTO_HOPOPTS; ip6h->nexthdr = IPPROTO_HOPOPTS;
ip6h->hop_limit = 1; ip6h->hop_limit = 1;
ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0); ipv6_dev_get_saddr(dev_net(br->dev), br->dev, &ip6h->daddr, 0,
&ip6h->saddr);
ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1)); ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1));
ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest);
hopopt = (u8 *)(ip6h + 1); hopopt = (u8 *)(ip6h + 1);
hopopt[0] = IPPROTO_ICMPV6; /* next hdr */ hopopt[0] = IPPROTO_ICMPV6; /* next hdr */
...@@ -780,11 +780,11 @@ static int br_ip6_multicast_add_group(struct net_bridge *br, ...@@ -780,11 +780,11 @@ static int br_ip6_multicast_add_group(struct net_bridge *br,
{ {
struct br_ip br_group; struct br_ip br_group;
if (ipv6_is_local_multicast(group)) if (!ipv6_is_transient_multicast(group))
return 0; return 0;
ipv6_addr_copy(&br_group.u.ip6, group); ipv6_addr_copy(&br_group.u.ip6, group);
br_group.proto = htons(ETH_P_IP); br_group.proto = htons(ETH_P_IPV6);
return br_multicast_add_group(br, port, &br_group); return br_multicast_add_group(br, port, &br_group);
} }
...@@ -1013,18 +1013,19 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, ...@@ -1013,18 +1013,19 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
nsrcs = skb_header_pointer(skb, nsrcs = skb_header_pointer(skb,
len + offsetof(struct mld2_grec, len + offsetof(struct mld2_grec,
grec_mca), grec_nsrcs),
sizeof(_nsrcs), &_nsrcs); sizeof(_nsrcs), &_nsrcs);
if (!nsrcs) if (!nsrcs)
return -EINVAL; return -EINVAL;
if (!pskb_may_pull(skb, if (!pskb_may_pull(skb,
len + sizeof(*grec) + len + sizeof(*grec) +
sizeof(struct in6_addr) * (*nsrcs))) sizeof(struct in6_addr) * ntohs(*nsrcs)))
return -EINVAL; return -EINVAL;
grec = (struct mld2_grec *)(skb->data + len); grec = (struct mld2_grec *)(skb->data + len);
len += sizeof(*grec) + sizeof(struct in6_addr) * (*nsrcs); len += sizeof(*grec) +
sizeof(struct in6_addr) * ntohs(*nsrcs);
/* We treat these as MLDv1 reports for now. */ /* We treat these as MLDv1 reports for now. */
switch (grec->grec_type) { switch (grec->grec_type) {
...@@ -1340,7 +1341,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br, ...@@ -1340,7 +1341,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br,
{ {
struct br_ip br_group; struct br_ip br_group;
if (ipv6_is_local_multicast(group)) if (!ipv6_is_transient_multicast(group))
return; return;
ipv6_addr_copy(&br_group.u.ip6, group); ipv6_addr_copy(&br_group.u.ip6, group);
......
...@@ -505,7 +505,9 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo, ...@@ -505,7 +505,9 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo,
} }
rcu_read_unlock(); rcu_read_unlock();
local_bh_disable();
inet_twsk_deschedule(tw, twdr); inet_twsk_deschedule(tw, twdr);
local_bh_enable();
inet_twsk_put(tw); inet_twsk_put(tw);
goto restart_rcu; goto restart_rcu;
} }
......
...@@ -1222,7 +1222,7 @@ static int tcp_check_dsack(struct sock *sk, struct sk_buff *ack_skb, ...@@ -1222,7 +1222,7 @@ static int tcp_check_dsack(struct sock *sk, struct sk_buff *ack_skb,
} }
/* D-SACK for already forgotten data... Do dumb counting. */ /* D-SACK for already forgotten data... Do dumb counting. */
if (dup_sack && if (dup_sack && tp->undo_marker && tp->undo_retrans &&
!after(end_seq_0, prior_snd_una) && !after(end_seq_0, prior_snd_una) &&
after(end_seq_0, tp->undo_marker)) after(end_seq_0, tp->undo_marker))
tp->undo_retrans--; tp->undo_retrans--;
...@@ -1299,7 +1299,8 @@ static u8 tcp_sacktag_one(struct sk_buff *skb, struct sock *sk, ...@@ -1299,7 +1299,8 @@ static u8 tcp_sacktag_one(struct sk_buff *skb, struct sock *sk,
/* Account D-SACK for retransmitted packet. */ /* Account D-SACK for retransmitted packet. */
if (dup_sack && (sacked & TCPCB_RETRANS)) { if (dup_sack && (sacked & TCPCB_RETRANS)) {
if (after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker)) if (tp->undo_marker && tp->undo_retrans &&
after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker))
tp->undo_retrans--; tp->undo_retrans--;
if (sacked & TCPCB_SACKED_ACKED) if (sacked & TCPCB_SACKED_ACKED)
state->reord = min(fack_count, state->reord); state->reord = min(fack_count, state->reord);
......
...@@ -2162,7 +2162,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) ...@@ -2162,7 +2162,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
if (!tp->retrans_stamp) if (!tp->retrans_stamp)
tp->retrans_stamp = TCP_SKB_CB(skb)->when; tp->retrans_stamp = TCP_SKB_CB(skb)->when;
tp->undo_retrans++; tp->undo_retrans += tcp_skb_pcount(skb);
/* snd_nxt is stored to detect loss of retransmitted segment, /* snd_nxt is stored to detect loss of retransmitted segment,
* see tcp_input.c tcp_sacktag_write_queue(). * see tcp_input.c tcp_sacktag_write_queue().
......
...@@ -410,7 +410,7 @@ static void dump_mac_header(struct sbuff *m, ...@@ -410,7 +410,7 @@ static void dump_mac_header(struct sbuff *m,
if (p != NULL) { if (p != NULL) {
sb_add(m, "%02x", *p++); sb_add(m, "%02x", *p++);
for (i = 1; i < len; i++) for (i = 1; i < len; i++)
sb_add(m, ":%02x", p[i]); sb_add(m, ":%02x", *p++);
} }
sb_add(m, " "); sb_add(m, " ");
......
...@@ -1229,6 +1229,7 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) ...@@ -1229,6 +1229,7 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local)
} }
mutex_unlock(&local->iflist_mtx); mutex_unlock(&local->iflist_mtx);
unregister_netdevice_many(&unreg_list); unregister_netdevice_many(&unreg_list);
list_del(&unreg_list);
} }
static u32 ieee80211_idle_off(struct ieee80211_local *local, static u32 ieee80211_idle_off(struct ieee80211_local *local,
......
...@@ -1033,6 +1033,12 @@ void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, ...@@ -1033,6 +1033,12 @@ void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
if (is_multicast_ether_addr(hdr->addr1)) if (is_multicast_ether_addr(hdr->addr1))
return; return;
/*
* In case we receive frames after disassociation.
*/
if (!sdata->u.mgd.associated)
return;
ieee80211_sta_reset_conn_monitor(sdata); ieee80211_sta_reset_conn_monitor(sdata);
} }
......
...@@ -28,26 +28,23 @@ nf_tproxy_destructor(struct sk_buff *skb) ...@@ -28,26 +28,23 @@ nf_tproxy_destructor(struct sk_buff *skb)
skb->destructor = NULL; skb->destructor = NULL;
if (sk) if (sk)
nf_tproxy_put_sock(sk); sock_put(sk);
} }
/* consumes sk */ /* consumes sk */
int void
nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk)
{ {
bool transparent = (sk->sk_state == TCP_TIME_WAIT) ? /* assigning tw sockets complicates things; most
inet_twsk(sk)->tw_transparent : * skb->sk->X checks would have to test sk->sk_state first */
inet_sk(sk)->transparent; if (sk->sk_state == TCP_TIME_WAIT) {
inet_twsk_put(inet_twsk(sk));
if (transparent) { return;
skb_orphan(skb); }
skb->sk = sk;
skb->destructor = nf_tproxy_destructor; skb_orphan(skb);
return 1; skb->sk = sk;
} else skb->destructor = nf_tproxy_destructor;
nf_tproxy_put_sock(sk);
return 0;
} }
EXPORT_SYMBOL_GPL(nf_tproxy_assign_sock); EXPORT_SYMBOL_GPL(nf_tproxy_assign_sock);
......
...@@ -33,6 +33,20 @@ ...@@ -33,6 +33,20 @@
#include <net/netfilter/nf_tproxy_core.h> #include <net/netfilter/nf_tproxy_core.h>
#include <linux/netfilter/xt_TPROXY.h> #include <linux/netfilter/xt_TPROXY.h>
static bool tproxy_sk_is_transparent(struct sock *sk)
{
if (sk->sk_state != TCP_TIME_WAIT) {
if (inet_sk(sk)->transparent)
return true;
sock_put(sk);
} else {
if (inet_twsk(sk)->tw_transparent)
return true;
inet_twsk_put(inet_twsk(sk));
}
return false;
}
static inline __be32 static inline __be32
tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr) tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr)
{ {
...@@ -141,7 +155,7 @@ tproxy_tg4(struct sk_buff *skb, __be32 laddr, __be16 lport, ...@@ -141,7 +155,7 @@ tproxy_tg4(struct sk_buff *skb, __be32 laddr, __be16 lport,
skb->dev, NFT_LOOKUP_LISTENER); skb->dev, NFT_LOOKUP_LISTENER);
/* NOTE: assign_sock consumes our sk reference */ /* NOTE: assign_sock consumes our sk reference */
if (sk && nf_tproxy_assign_sock(skb, sk)) { if (sk && tproxy_sk_is_transparent(sk)) {
/* This should be in a separate target, but we don't do multiple /* This should be in a separate target, but we don't do multiple
targets on the same rule yet */ targets on the same rule yet */
skb->mark = (skb->mark & ~mark_mask) ^ mark_value; skb->mark = (skb->mark & ~mark_mask) ^ mark_value;
...@@ -149,6 +163,8 @@ tproxy_tg4(struct sk_buff *skb, __be32 laddr, __be16 lport, ...@@ -149,6 +163,8 @@ tproxy_tg4(struct sk_buff *skb, __be32 laddr, __be16 lport,
pr_debug("redirecting: proto %hhu %pI4:%hu -> %pI4:%hu, mark: %x\n", pr_debug("redirecting: proto %hhu %pI4:%hu -> %pI4:%hu, mark: %x\n",
iph->protocol, &iph->daddr, ntohs(hp->dest), iph->protocol, &iph->daddr, ntohs(hp->dest),
&laddr, ntohs(lport), skb->mark); &laddr, ntohs(lport), skb->mark);
nf_tproxy_assign_sock(skb, sk);
return NF_ACCEPT; return NF_ACCEPT;
} }
...@@ -306,7 +322,7 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par) ...@@ -306,7 +322,7 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par)
par->in, NFT_LOOKUP_LISTENER); par->in, NFT_LOOKUP_LISTENER);
/* NOTE: assign_sock consumes our sk reference */ /* NOTE: assign_sock consumes our sk reference */
if (sk && nf_tproxy_assign_sock(skb, sk)) { if (sk && tproxy_sk_is_transparent(sk)) {
/* This should be in a separate target, but we don't do multiple /* This should be in a separate target, but we don't do multiple
targets on the same rule yet */ targets on the same rule yet */
skb->mark = (skb->mark & ~tgi->mark_mask) ^ tgi->mark_value; skb->mark = (skb->mark & ~tgi->mark_mask) ^ tgi->mark_value;
...@@ -314,6 +330,8 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par) ...@@ -314,6 +330,8 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par)
pr_debug("redirecting: proto %hhu %pI6:%hu -> %pI6:%hu, mark: %x\n", pr_debug("redirecting: proto %hhu %pI6:%hu -> %pI6:%hu, mark: %x\n",
tproto, &iph->saddr, ntohs(hp->source), tproto, &iph->saddr, ntohs(hp->source),
laddr, ntohs(lport), skb->mark); laddr, ntohs(lport), skb->mark);
nf_tproxy_assign_sock(skb, sk);
return NF_ACCEPT; return NF_ACCEPT;
} }
......
...@@ -35,6 +35,15 @@ ...@@ -35,6 +35,15 @@
#include <net/netfilter/nf_conntrack.h> #include <net/netfilter/nf_conntrack.h>
#endif #endif
static void
xt_socket_put_sk(struct sock *sk)
{
if (sk->sk_state == TCP_TIME_WAIT)
inet_twsk_put(inet_twsk(sk));
else
sock_put(sk);
}
static int static int
extract_icmp4_fields(const struct sk_buff *skb, extract_icmp4_fields(const struct sk_buff *skb,
u8 *protocol, u8 *protocol,
...@@ -164,7 +173,7 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par, ...@@ -164,7 +173,7 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,
(sk->sk_state == TCP_TIME_WAIT && (sk->sk_state == TCP_TIME_WAIT &&
inet_twsk(sk)->tw_transparent)); inet_twsk(sk)->tw_transparent));
nf_tproxy_put_sock(sk); xt_socket_put_sk(sk);
if (wildcard || !transparent) if (wildcard || !transparent)
sk = NULL; sk = NULL;
...@@ -298,7 +307,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par) ...@@ -298,7 +307,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)
(sk->sk_state == TCP_TIME_WAIT && (sk->sk_state == TCP_TIME_WAIT &&
inet_twsk(sk)->tw_transparent)); inet_twsk(sk)->tw_transparent));
nf_tproxy_put_sock(sk); xt_socket_put_sk(sk);
if (wildcard || !transparent) if (wildcard || !transparent)
sk = NULL; sk = NULL;
......
...@@ -839,6 +839,7 @@ void dev_deactivate(struct net_device *dev) ...@@ -839,6 +839,7 @@ void dev_deactivate(struct net_device *dev)
list_add(&dev->unreg_list, &single); list_add(&dev->unreg_list, &single);
dev_deactivate_many(&single); dev_deactivate_many(&single);
list_del(&single);
} }
static void dev_init_scheduler_queue(struct net_device *dev, static void dev_init_scheduler_queue(struct net_device *dev,
......
...@@ -2029,11 +2029,11 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc, ...@@ -2029,11 +2029,11 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc,
*errp = sctp_make_op_error_fixed(asoc, chunk); *errp = sctp_make_op_error_fixed(asoc, chunk);
if (*errp) { if (*errp) {
sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM, if (!sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM,
WORD_ROUND(ntohs(param.p->length))); WORD_ROUND(ntohs(param.p->length))))
sctp_addto_chunk_fixed(*errp, sctp_addto_chunk_fixed(*errp,
WORD_ROUND(ntohs(param.p->length)), WORD_ROUND(ntohs(param.p->length)),
param.v); param.v);
} else { } else {
/* If there is no memory for generating the ERROR /* If there is no memory for generating the ERROR
* report as specified, an ABORT will be triggered * report as specified, an ABORT will be triggered
......
...@@ -802,11 +802,11 @@ int cfg80211_wext_siwfreq(struct net_device *dev, ...@@ -802,11 +802,11 @@ int cfg80211_wext_siwfreq(struct net_device *dev,
return freq; return freq;
if (freq == 0) if (freq == 0)
return -EINVAL; return -EINVAL;
wdev_lock(wdev);
mutex_lock(&rdev->devlist_mtx); mutex_lock(&rdev->devlist_mtx);
wdev_lock(wdev);
err = cfg80211_set_freq(rdev, wdev, freq, NL80211_CHAN_NO_HT); err = cfg80211_set_freq(rdev, wdev, freq, NL80211_CHAN_NO_HT);
mutex_unlock(&rdev->devlist_mtx);
wdev_unlock(wdev); wdev_unlock(wdev);
mutex_unlock(&rdev->devlist_mtx);
return err; return err;
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment