Commit caf83945 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: (31 commits)
  net: fix kernel-doc for sk_filter_rcu_release
  be2net: Fix to avoid firmware update when interface is not open.
  netfilter: fix IP_VS dependencies
  net: irda: irttp: sync error paths of data- and udata-requests
  ipv6: Expose reachable and retrans timer values as msecs
  ipv6: Expose IFLA_PROTINFO timer values in msecs instead of jiffies
  3c59x: fix build failure on !CONFIG_PCI
  ipg.c: remove id [SUNDANCE, 0x1021]
  net: caif: spi: fix potential NULL dereference
  ath9k_htc: Avoid setting QoS control for non-QoS frames
  net: zero kobject in rx_queue_release
  net: Fix duplicate volatile warning.
  MAINTAINERS: Add stmmac maintainer
  bonding: fix a race in IGMP handling
  cfg80211: fix can_beacon_sec_chan, reenable HT40
  gianfar: fix signedness issue
  net: bnx2x: fix error value sign
  8139cp: fix checksum broken
  r8169: fix checksum broken
  rds: Integer overflow in RDS cmsg handling
  ...
parents 6656b3fc 0302b862
...@@ -1829,6 +1829,13 @@ W: http://www.chelsio.com ...@@ -1829,6 +1829,13 @@ W: http://www.chelsio.com
S: Supported S: Supported
F: drivers/net/cxgb4vf/ F: drivers/net/cxgb4vf/
STMMAC ETHERNET DRIVER
M: Giuseppe Cavallaro <peppe.cavallaro@st.com>
L: netdev@vger.kernel.org
W: http://www.stlinux.com
S: Supported
F: drivers/net/stmmac/
CYBERPRO FB DRIVER CYBERPRO FB DRIVER
M: Russell King <linux@arm.linux.org.uk> M: Russell King <linux@arm.linux.org.uk>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
......
...@@ -699,7 +699,8 @@ DEFINE_WINDOW_IO(32) ...@@ -699,7 +699,8 @@ DEFINE_WINDOW_IO(32)
#define DEVICE_PCI(dev) NULL #define DEVICE_PCI(dev) NULL
#endif #endif
#define VORTEX_PCI(vp) (((vp)->gendev) ? DEVICE_PCI((vp)->gendev) : NULL) #define VORTEX_PCI(vp) \
((struct pci_dev *) (((vp)->gendev) ? DEVICE_PCI((vp)->gendev) : NULL))
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
#define DEVICE_EISA(dev) (((dev)->bus == &eisa_bus_type) ? to_eisa_device((dev)) : NULL) #define DEVICE_EISA(dev) (((dev)->bus == &eisa_bus_type) ? to_eisa_device((dev)) : NULL)
...@@ -707,7 +708,8 @@ DEFINE_WINDOW_IO(32) ...@@ -707,7 +708,8 @@ DEFINE_WINDOW_IO(32)
#define DEVICE_EISA(dev) NULL #define DEVICE_EISA(dev) NULL
#endif #endif
#define VORTEX_EISA(vp) (((vp)->gendev) ? DEVICE_EISA((vp)->gendev) : NULL) #define VORTEX_EISA(vp) \
((struct eisa_device *) (((vp)->gendev) ? DEVICE_EISA((vp)->gendev) : NULL))
/* The action to take with a media selection timer tick. /* The action to take with a media selection timer tick.
Note that we deviate from the 3Com order by checking 10base2 before AUI. Note that we deviate from the 3Com order by checking 10base2 before AUI.
......
...@@ -490,13 +490,11 @@ static inline unsigned int cp_rx_csum_ok (u32 status) ...@@ -490,13 +490,11 @@ static inline unsigned int cp_rx_csum_ok (u32 status)
{ {
unsigned int protocol = (status >> 16) & 0x3; unsigned int protocol = (status >> 16) & 0x3;
if (likely((protocol == RxProtoTCP) && (!(status & TCPFail)))) if (((protocol == RxProtoTCP) && !(status & TCPFail)) ||
((protocol == RxProtoUDP) && !(status & UDPFail)))
return 1; return 1;
else if ((protocol == RxProtoUDP) && (!(status & UDPFail))) else
return 1; return 0;
else if ((protocol == RxProtoIP) && (!(status & IPFail)))
return 1;
return 0;
} }
static int cp_rx_poll(struct napi_struct *napi, int budget) static int cp_rx_poll(struct napi_struct *napi, int budget)
......
...@@ -2458,6 +2458,12 @@ int be_load_fw(struct be_adapter *adapter, u8 *func) ...@@ -2458,6 +2458,12 @@ int be_load_fw(struct be_adapter *adapter, u8 *func)
int status, i = 0, num_imgs = 0; int status, i = 0, num_imgs = 0;
const u8 *p; const u8 *p;
if (!netif_running(adapter->netdev)) {
dev_err(&adapter->pdev->dev,
"Firmware load not allowed (interface is down)\n");
return -EPERM;
}
strcpy(fw_file, func); strcpy(fw_file, func);
status = request_firmware(&fw, fw_file, &adapter->pdev->dev); status = request_firmware(&fw, fw_file, &adapter->pdev->dev);
......
...@@ -9064,7 +9064,7 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, ...@@ -9064,7 +9064,7 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
default: default:
pr_err("Unknown board_type (%ld), aborting\n", pr_err("Unknown board_type (%ld), aborting\n",
ent->driver_data); ent->driver_data);
return ENODEV; return -ENODEV;
} }
cid_count += CNIC_CONTEXT_USE; cid_count += CNIC_CONTEXT_USE;
......
...@@ -878,8 +878,10 @@ static void __bond_resend_igmp_join_requests(struct net_device *dev) ...@@ -878,8 +878,10 @@ static void __bond_resend_igmp_join_requests(struct net_device *dev)
rcu_read_lock(); rcu_read_lock();
in_dev = __in_dev_get_rcu(dev); in_dev = __in_dev_get_rcu(dev);
if (in_dev) { if (in_dev) {
read_lock(&in_dev->mc_list_lock);
for (im = in_dev->mc_list; im; im = im->next) for (im = in_dev->mc_list; im; im = im->next)
ip_mc_rejoin_group(im); ip_mc_rejoin_group(im);
read_unlock(&in_dev->mc_list_lock);
} }
rcu_read_unlock(); rcu_read_unlock();
......
...@@ -635,8 +635,8 @@ int cfspi_spi_probe(struct platform_device *pdev) ...@@ -635,8 +635,8 @@ int cfspi_spi_probe(struct platform_device *pdev)
ndev = alloc_netdev(sizeof(struct cfspi), ndev = alloc_netdev(sizeof(struct cfspi),
"cfspi%d", cfspi_setup); "cfspi%d", cfspi_setup);
if (!dev) if (!ndev)
return -ENODEV; return -ENOMEM;
cfspi = netdev_priv(ndev); cfspi = netdev_priv(ndev);
netif_stop_queue(ndev); netif_stop_queue(ndev);
......
...@@ -577,11 +577,10 @@ static int gfar_parse_group(struct device_node *np, ...@@ -577,11 +577,10 @@ static int gfar_parse_group(struct device_node *np,
irq_of_parse_and_map(np, 1); irq_of_parse_and_map(np, 1);
priv->gfargrp[priv->num_grps].interruptError = priv->gfargrp[priv->num_grps].interruptError =
irq_of_parse_and_map(np,2); irq_of_parse_and_map(np,2);
if (priv->gfargrp[priv->num_grps].interruptTransmit < 0 || if (priv->gfargrp[priv->num_grps].interruptTransmit == NO_IRQ ||
priv->gfargrp[priv->num_grps].interruptReceive < 0 || priv->gfargrp[priv->num_grps].interruptReceive == NO_IRQ ||
priv->gfargrp[priv->num_grps].interruptError < 0) { priv->gfargrp[priv->num_grps].interruptError == NO_IRQ)
return -EINVAL; return -EINVAL;
}
} }
priv->gfargrp[priv->num_grps].grp_id = priv->num_grps; priv->gfargrp[priv->num_grps].grp_id = priv->num_grps;
......
...@@ -88,16 +88,14 @@ static const char *ipg_brand_name[] = { ...@@ -88,16 +88,14 @@ static const char *ipg_brand_name[] = {
"IC PLUS IP1000 1000/100/10 based NIC", "IC PLUS IP1000 1000/100/10 based NIC",
"Sundance Technology ST2021 based NIC", "Sundance Technology ST2021 based NIC",
"Tamarack Microelectronics TC9020/9021 based NIC", "Tamarack Microelectronics TC9020/9021 based NIC",
"Tamarack Microelectronics TC9020/9021 based NIC",
"D-Link NIC IP1000A" "D-Link NIC IP1000A"
}; };
static DEFINE_PCI_DEVICE_TABLE(ipg_pci_tbl) = { static DEFINE_PCI_DEVICE_TABLE(ipg_pci_tbl) = {
{ PCI_VDEVICE(SUNDANCE, 0x1023), 0 }, { PCI_VDEVICE(SUNDANCE, 0x1023), 0 },
{ PCI_VDEVICE(SUNDANCE, 0x2021), 1 }, { PCI_VDEVICE(SUNDANCE, 0x2021), 1 },
{ PCI_VDEVICE(SUNDANCE, 0x1021), 2 }, { PCI_VDEVICE(DLINK, 0x9021), 2 },
{ PCI_VDEVICE(DLINK, 0x9021), 3 }, { PCI_VDEVICE(DLINK, 0x4020), 3 },
{ PCI_VDEVICE(DLINK, 0x4020), 4 },
{ 0, } { 0, }
}; };
......
...@@ -4440,8 +4440,7 @@ static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1) ...@@ -4440,8 +4440,7 @@ static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1)
u32 status = opts1 & RxProtoMask; u32 status = opts1 & RxProtoMask;
if (((status == RxProtoTCP) && !(opts1 & TCPFail)) || if (((status == RxProtoTCP) && !(opts1 & TCPFail)) ||
((status == RxProtoUDP) && !(opts1 & UDPFail)) || ((status == RxProtoUDP) && !(opts1 & UDPFail)))
((status == RxProtoIP) && !(opts1 & IPFail)))
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
else else
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
......
...@@ -37,7 +37,7 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah) ...@@ -37,7 +37,7 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
int addr, eep_start_loc; int addr, eep_start_loc;
eep_data = (u16 *)eep; eep_data = (u16 *)eep;
if (ah->hw_version.devid == 0x7015) if (AR9287_HTC_DEVID(ah))
eep_start_loc = AR9287_HTC_EEP_START_LOC; eep_start_loc = AR9287_HTC_EEP_START_LOC;
else else
eep_start_loc = AR9287_EEP_START_LOC; eep_start_loc = AR9287_EEP_START_LOC;
......
...@@ -36,8 +36,13 @@ static struct usb_device_id ath9k_hif_usb_ids[] = { ...@@ -36,8 +36,13 @@ static struct usb_device_id ath9k_hif_usb_ids[] = {
{ USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
{ USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */
{ USB_DEVICE(0x13D3, 0x3346) }, /* IMC Networks */ { USB_DEVICE(0x13D3, 0x3346) }, /* IMC Networks */
{ USB_DEVICE(0x13D3, 0x3348) }, /* Azurewave */
{ USB_DEVICE(0x13D3, 0x3349) }, /* Azurewave */
{ USB_DEVICE(0x13D3, 0x3350) }, /* Azurewave */
{ USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */ { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */
{ USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */ { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */
{ USB_DEVICE(0x040D, 0x3801) }, /* VIA */
{ USB_DEVICE(0x1668, 0x1200) }, /* Verizon */
{ }, { },
}; };
...@@ -806,6 +811,8 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) ...@@ -806,6 +811,8 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
case 0x7010: case 0x7010:
case 0x7015: case 0x7015:
case 0x9018: case 0x9018:
case 0xA704:
case 0x1200:
firm_offset = AR7010_FIRMWARE_TEXT; firm_offset = AR7010_FIRMWARE_TEXT;
break; break;
default: default:
...@@ -928,6 +935,8 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, ...@@ -928,6 +935,8 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
case 0x7010: case 0x7010:
case 0x7015: case 0x7015:
case 0x9018: case 0x9018:
case 0xA704:
case 0x1200:
if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202) if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202)
hif_dev->fw_name = FIRMWARE_AR7010_1_1; hif_dev->fw_name = FIRMWARE_AR7010_1_1;
else else
......
...@@ -249,6 +249,8 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid) ...@@ -249,6 +249,8 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid)
case 0x7010: case 0x7010:
case 0x7015: case 0x7015:
case 0x9018: case 0x9018:
case 0xA704:
case 0x1200:
priv->htc->credits = 45; priv->htc->credits = 45;
break; break;
default: default:
......
...@@ -121,7 +121,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb) ...@@ -121,7 +121,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
tx_hdr.data_type = ATH9K_HTC_NORMAL; tx_hdr.data_type = ATH9K_HTC_NORMAL;
} }
if (ieee80211_is_data(fc)) { if (ieee80211_is_data_qos(fc)) {
qc = ieee80211_get_qos_ctl(hdr); qc = ieee80211_get_qos_ctl(hdr);
tx_hdr.tidno = qc[0] & IEEE80211_QOS_CTL_TID_MASK; tx_hdr.tidno = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
} }
......
...@@ -817,8 +817,6 @@ void ath9k_deinit_device(struct ath_softc *sc) ...@@ -817,8 +817,6 @@ void ath9k_deinit_device(struct ath_softc *sc)
ath9k_ps_wakeup(sc); ath9k_ps_wakeup(sc);
pm_qos_remove_request(&ath9k_pm_qos_req);
wiphy_rfkill_stop_polling(sc->hw->wiphy); wiphy_rfkill_stop_polling(sc->hw->wiphy);
ath_deinit_leds(sc); ath_deinit_leds(sc);
...@@ -832,6 +830,7 @@ void ath9k_deinit_device(struct ath_softc *sc) ...@@ -832,6 +830,7 @@ void ath9k_deinit_device(struct ath_softc *sc)
} }
ieee80211_unregister_hw(hw); ieee80211_unregister_hw(hw);
pm_qos_remove_request(&ath9k_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);
......
...@@ -866,7 +866,13 @@ ...@@ -866,7 +866,13 @@
#define AR_DEVID_7010(_ah) \ #define AR_DEVID_7010(_ah) \
(((_ah)->hw_version.devid == 0x7010) || \ (((_ah)->hw_version.devid == 0x7010) || \
((_ah)->hw_version.devid == 0x7015) || \ ((_ah)->hw_version.devid == 0x7015) || \
((_ah)->hw_version.devid == 0x9018)) ((_ah)->hw_version.devid == 0x9018) || \
((_ah)->hw_version.devid == 0xA704) || \
((_ah)->hw_version.devid == 0x1200))
#define AR9287_HTC_DEVID(_ah) \
(((_ah)->hw_version.devid == 0x7015) || \
((_ah)->hw_version.devid == 0x1200))
#define AR_RADIO_SREV_MAJOR 0xf0 #define AR_RADIO_SREV_MAJOR 0xf0
#define AR_RAD5133_SREV_MAJOR 0xc0 #define AR_RAD5133_SREV_MAJOR 0xc0
......
...@@ -553,12 +553,12 @@ static int carl9170_usb_flush(struct ar9170 *ar) ...@@ -553,12 +553,12 @@ static int carl9170_usb_flush(struct ar9170 *ar)
usb_free_urb(urb); usb_free_urb(urb);
} }
ret = usb_wait_anchor_empty_timeout(&ar->tx_cmd, HZ); ret = usb_wait_anchor_empty_timeout(&ar->tx_cmd, 1000);
if (ret == 0) if (ret == 0)
err = -ETIMEDOUT; err = -ETIMEDOUT;
/* lets wait a while until the tx - queues are dried out */ /* lets wait a while until the tx - queues are dried out */
ret = usb_wait_anchor_empty_timeout(&ar->tx_anch, HZ); ret = usb_wait_anchor_empty_timeout(&ar->tx_anch, 1000);
if (ret == 0) if (ret == 0)
err = -ETIMEDOUT; err = -ETIMEDOUT;
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <linux/if_link.h> #include <linux/if_link.h>
#include <linux/if_addr.h> #include <linux/if_addr.h>
#include <linux/neighbour.h> #include <linux/neighbour.h>
#include <linux/netdevice.h>
/* rtnetlink families. Values up to 127 are reserved for real address /* rtnetlink families. Values up to 127 are reserved for real address
* families, values above 128 may be used arbitrarily. * families, values above 128 may be used arbitrarily.
...@@ -606,6 +605,7 @@ struct tcamsg { ...@@ -606,6 +605,7 @@ struct tcamsg {
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/netdevice.h>
static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
{ {
......
...@@ -1355,7 +1355,7 @@ enum wiphy_flags { ...@@ -1355,7 +1355,7 @@ enum wiphy_flags {
WIPHY_FLAG_4ADDR_AP = BIT(5), WIPHY_FLAG_4ADDR_AP = BIT(5),
WIPHY_FLAG_4ADDR_STATION = BIT(6), WIPHY_FLAG_4ADDR_STATION = BIT(6),
WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
WIPHY_FLAG_IBSS_RSN = BIT(7), WIPHY_FLAG_IBSS_RSN = BIT(8),
}; };
struct mac_address { struct mac_address {
......
...@@ -303,7 +303,7 @@ static inline void neigh_confirm(struct neighbour *neigh) ...@@ -303,7 +303,7 @@ static inline void neigh_confirm(struct neighbour *neigh)
static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
{ {
unsigned long now = ACCESS_ONCE(jiffies); unsigned long now = jiffies;
if (neigh->used != now) if (neigh->used != now)
neigh->used = now; neigh->used = now;
......
...@@ -589,7 +589,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen) ...@@ -589,7 +589,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
EXPORT_SYMBOL(sk_chk_filter); EXPORT_SYMBOL(sk_chk_filter);
/** /**
* sk_filter_rcu_release: Release a socket filter by rcu_head * sk_filter_rcu_release - Release a socket filter by rcu_head
* @rcu: rcu_head that contains the sk_filter to free * @rcu: rcu_head that contains the sk_filter to free
*/ */
static void sk_filter_rcu_release(struct rcu_head *rcu) static void sk_filter_rcu_release(struct rcu_head *rcu)
......
...@@ -712,15 +712,21 @@ static void rx_queue_release(struct kobject *kobj) ...@@ -712,15 +712,21 @@ static void rx_queue_release(struct kobject *kobj)
map = rcu_dereference_raw(queue->rps_map); map = rcu_dereference_raw(queue->rps_map);
if (map) if (map) {
RCU_INIT_POINTER(queue->rps_map, NULL);
call_rcu(&map->rcu, rps_map_release); call_rcu(&map->rcu, rps_map_release);
}
flow_table = rcu_dereference_raw(queue->rps_flow_table); flow_table = rcu_dereference_raw(queue->rps_flow_table);
if (flow_table) if (flow_table) {
RCU_INIT_POINTER(queue->rps_flow_table, NULL);
call_rcu(&flow_table->rcu, rps_dev_flow_table_release); call_rcu(&flow_table->rcu, rps_dev_flow_table_release);
}
if (atomic_dec_and_test(&first->count)) if (atomic_dec_and_test(&first->count))
kfree(first); kfree(first);
else
memset(kobj, 0, sizeof(*kobj));
} }
static struct kobj_type rx_queue_ktype = { static struct kobj_type rx_queue_ktype = {
......
...@@ -569,6 +569,9 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) ...@@ -569,6 +569,9 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
/* No need to clone since we're just using its address. */ /* No need to clone since we're just using its address. */
rt2 = rt; rt2 = rt;
if (!fl.nl_u.ip4_u.saddr)
fl.nl_u.ip4_u.saddr = rt->rt_src;
err = xfrm_lookup(net, (struct dst_entry **)&rt, &fl, NULL, 0); err = xfrm_lookup(net, (struct dst_entry **)&rt, &fl, NULL, 0);
switch (err) { switch (err) {
case 0: case 0:
......
...@@ -98,7 +98,11 @@ ...@@ -98,7 +98,11 @@
#endif #endif
#define INFINITY_LIFE_TIME 0xFFFFFFFF #define INFINITY_LIFE_TIME 0xFFFFFFFF
#define TIME_DELTA(a, b) ((unsigned long)((long)(a) - (long)(b)))
static inline u32 cstamp_delta(unsigned long cstamp)
{
return (cstamp - INITIAL_JIFFIES) * 100UL / HZ;
}
#define ADDRCONF_TIMER_FUZZ_MINUS (HZ > 50 ? HZ/50 : 1) #define ADDRCONF_TIMER_FUZZ_MINUS (HZ > 50 ? HZ/50 : 1)
#define ADDRCONF_TIMER_FUZZ (HZ / 4) #define ADDRCONF_TIMER_FUZZ (HZ / 4)
...@@ -3444,10 +3448,8 @@ static int put_cacheinfo(struct sk_buff *skb, unsigned long cstamp, ...@@ -3444,10 +3448,8 @@ static int put_cacheinfo(struct sk_buff *skb, unsigned long cstamp,
{ {
struct ifa_cacheinfo ci; struct ifa_cacheinfo ci;
ci.cstamp = (u32)(TIME_DELTA(cstamp, INITIAL_JIFFIES) / HZ * 100 ci.cstamp = cstamp_delta(cstamp);
+ TIME_DELTA(cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); ci.tstamp = cstamp_delta(tstamp);
ci.tstamp = (u32)(TIME_DELTA(tstamp, INITIAL_JIFFIES) / HZ * 100
+ TIME_DELTA(tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ);
ci.ifa_prefered = preferred; ci.ifa_prefered = preferred;
ci.ifa_valid = valid; ci.ifa_valid = valid;
...@@ -3798,8 +3800,10 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, ...@@ -3798,8 +3800,10 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
array[DEVCONF_AUTOCONF] = cnf->autoconf; array[DEVCONF_AUTOCONF] = cnf->autoconf;
array[DEVCONF_DAD_TRANSMITS] = cnf->dad_transmits; array[DEVCONF_DAD_TRANSMITS] = cnf->dad_transmits;
array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits; array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits;
array[DEVCONF_RTR_SOLICIT_INTERVAL] = cnf->rtr_solicit_interval; array[DEVCONF_RTR_SOLICIT_INTERVAL] =
array[DEVCONF_RTR_SOLICIT_DELAY] = cnf->rtr_solicit_delay; jiffies_to_msecs(cnf->rtr_solicit_interval);
array[DEVCONF_RTR_SOLICIT_DELAY] =
jiffies_to_msecs(cnf->rtr_solicit_delay);
array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version; array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version;
#ifdef CONFIG_IPV6_PRIVACY #ifdef CONFIG_IPV6_PRIVACY
array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr; array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr;
...@@ -3813,7 +3817,8 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, ...@@ -3813,7 +3817,8 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
array[DEVCONF_ACCEPT_RA_PINFO] = cnf->accept_ra_pinfo; array[DEVCONF_ACCEPT_RA_PINFO] = cnf->accept_ra_pinfo;
#ifdef CONFIG_IPV6_ROUTER_PREF #ifdef CONFIG_IPV6_ROUTER_PREF
array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref; array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref;
array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval; array[DEVCONF_RTR_PROBE_INTERVAL] =
jiffies_to_msecs(cnf->rtr_probe_interval);
#ifdef CONFIG_IPV6_ROUTE_INFO #ifdef CONFIG_IPV6_ROUTE_INFO
array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen; array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen;
#endif #endif
...@@ -3929,10 +3934,9 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, ...@@ -3929,10 +3934,9 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev,
NLA_PUT_U32(skb, IFLA_INET6_FLAGS, idev->if_flags); NLA_PUT_U32(skb, IFLA_INET6_FLAGS, idev->if_flags);
ci.max_reasm_len = IPV6_MAXPLEN; ci.max_reasm_len = IPV6_MAXPLEN;
ci.tstamp = (__u32)(TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) / HZ * 100 ci.tstamp = cstamp_delta(idev->tstamp);
+ TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); ci.reachable_time = jiffies_to_msecs(idev->nd_parms->reachable_time);
ci.reachable_time = idev->nd_parms->reachable_time; ci.retrans_time = jiffies_to_msecs(idev->nd_parms->retrans_time);
ci.retrans_time = idev->nd_parms->retrans_time;
NLA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci); NLA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci);
nla = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32)); nla = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32));
......
...@@ -550,22 +550,30 @@ EXPORT_SYMBOL(irttp_close_tsap); ...@@ -550,22 +550,30 @@ EXPORT_SYMBOL(irttp_close_tsap);
*/ */
int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb)
{ {
int ret;
IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self != NULL, return -1;);
IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
IRDA_ASSERT(skb != NULL, return -1;); IRDA_ASSERT(skb != NULL, return -1;);
IRDA_DEBUG(4, "%s()\n", __func__); IRDA_DEBUG(4, "%s()\n", __func__);
/* Take shortcut on zero byte packets */
if (skb->len == 0) {
ret = 0;
goto err;
}
/* Check that nothing bad happens */ /* Check that nothing bad happens */
if ((skb->len == 0) || (!self->connected)) { if (!self->connected) {
IRDA_DEBUG(1, "%s(), No data, or not connected\n", IRDA_WARNING("%s(), Not connected\n", __func__);
__func__); ret = -ENOTCONN;
goto err; goto err;
} }
if (skb->len > self->max_seg_size) { if (skb->len > self->max_seg_size) {
IRDA_DEBUG(1, "%s(), UData is too large for IrLAP!\n", IRDA_ERROR("%s(), UData is too large for IrLAP!\n", __func__);
__func__); ret = -EMSGSIZE;
goto err; goto err;
} }
...@@ -576,7 +584,7 @@ int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -576,7 +584,7 @@ int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb)
err: err:
dev_kfree_skb(skb); dev_kfree_skb(skb);
return -1; return ret;
} }
EXPORT_SYMBOL(irttp_udata_request); EXPORT_SYMBOL(irttp_udata_request);
...@@ -599,9 +607,15 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -599,9 +607,15 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
IRDA_DEBUG(2, "%s() : queue len = %d\n", __func__, IRDA_DEBUG(2, "%s() : queue len = %d\n", __func__,
skb_queue_len(&self->tx_queue)); skb_queue_len(&self->tx_queue));
/* Take shortcut on zero byte packets */
if (skb->len == 0) {
ret = 0;
goto err;
}
/* Check that nothing bad happens */ /* Check that nothing bad happens */
if ((skb->len == 0) || (!self->connected)) { if (!self->connected) {
IRDA_WARNING("%s: No data, or not connected\n", __func__); IRDA_WARNING("%s: Not connected\n", __func__);
ret = -ENOTCONN; ret = -ENOTCONN;
goto err; goto err;
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
menuconfig IP_VS menuconfig IP_VS
tristate "IP virtual server support" tristate "IP virtual server support"
depends on NET && INET && NETFILTER depends on NET && INET && NETFILTER
depends on (NF_CONNTRACK || NF_CONNTRACK=n)
---help--- ---help---
IP Virtual Server support will let you build a high-performance IP Virtual Server support will let you build a high-performance
virtual server based on cluster of two or more real servers. This virtual server based on cluster of two or more real servers. This
......
...@@ -567,7 +567,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, ...@@ -567,7 +567,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
goto out; goto out;
} }
if (args->nr_local > (u64)UINT_MAX) { if (args->nr_local > UIO_MAXIOV) {
ret = -EMSGSIZE; ret = -EMSGSIZE;
goto out; goto out;
} }
......
...@@ -44,6 +44,38 @@ rdev_freq_to_chan(struct cfg80211_registered_device *rdev, ...@@ -44,6 +44,38 @@ rdev_freq_to_chan(struct cfg80211_registered_device *rdev,
return chan; return chan;
} }
static bool can_beacon_sec_chan(struct wiphy *wiphy,
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type)
{
struct ieee80211_channel *sec_chan;
int diff;
switch (channel_type) {
case NL80211_CHAN_HT40PLUS:
diff = 20;
break;
case NL80211_CHAN_HT40MINUS:
diff = -20;
break;
default:
return false;
}
sec_chan = ieee80211_get_channel(wiphy, chan->center_freq + diff);
if (!sec_chan)
return false;
/* we'll need a DFS capability later */
if (sec_chan->flags & (IEEE80211_CHAN_DISABLED |
IEEE80211_CHAN_PASSIVE_SCAN |
IEEE80211_CHAN_NO_IBSS |
IEEE80211_CHAN_RADAR))
return false;
return true;
}
int cfg80211_set_freq(struct cfg80211_registered_device *rdev, int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev, int freq, struct wireless_dev *wdev, int freq,
enum nl80211_channel_type channel_type) enum nl80211_channel_type channel_type)
...@@ -68,6 +100,28 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev, ...@@ -68,6 +100,28 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
if (!chan) if (!chan)
return -EINVAL; return -EINVAL;
/* Both channels should be able to initiate communication */
if (wdev && (wdev->iftype == NL80211_IFTYPE_ADHOC ||
wdev->iftype == NL80211_IFTYPE_AP ||
wdev->iftype == NL80211_IFTYPE_AP_VLAN ||
wdev->iftype == NL80211_IFTYPE_MESH_POINT ||
wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
switch (channel_type) {
case NL80211_CHAN_HT40PLUS:
case NL80211_CHAN_HT40MINUS:
if (!can_beacon_sec_chan(&rdev->wiphy, chan,
channel_type)) {
printk(KERN_DEBUG
"cfg80211: Secondary channel not "
"allowed to initiate communication\n");
return -EINVAL;
}
break;
default:
break;
}
}
result = rdev->ops->set_channel(&rdev->wiphy, result = rdev->ops->set_channel(&rdev->wiphy,
wdev ? wdev->netdev : NULL, wdev ? wdev->netdev : NULL,
chan, channel_type); chan, channel_type);
......
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