Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156354
b: refs/heads/master
c: cd3468b
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Aug 3, 2009
1 parent ea1a1c4 commit b9fecca
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 121 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6caa14aa0b126d4a2933907d1519611b2a8524a
refs/heads/master: cd3468bad96c00b5a512f551674f36776129520e
67 changes: 1 addition & 66 deletions trunk/drivers/net/ixgbe/ixgbe_82598.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,51 +49,6 @@ static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw,
static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
u8 *eeprom_data);

/**
* ixgbe_set_pcie_completion_timeout - set pci-e completion timeout
* @hw: pointer to the HW structure
*
* The defaults for 82598 should be in the range of 50us to 50ms,
* however the hardware default for these parts is 500us to 1ms which is less
* than the 10ms recommended by the pci-e spec. To address this we need to
* increase the value to either 10ms to 250ms for capability version 1 config,
* or 16ms to 55ms for version 2.
**/
void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw)
{
struct ixgbe_adapter *adapter = hw->back;
u32 gcr = IXGBE_READ_REG(hw, IXGBE_GCR);
u16 pcie_devctl2;

/* only take action if timeout value is defaulted to 0 */
if (gcr & IXGBE_GCR_CMPL_TMOUT_MASK)
goto out;

/*
* if capababilities version is type 1 we can write the
* timeout of 10ms to 250ms through the GCR register
*/
if (!(gcr & IXGBE_GCR_CAP_VER2)) {
gcr |= IXGBE_GCR_CMPL_TMOUT_10ms;
goto out;
}

/*
* for version 2 capabilities we need to write the config space
* directly in order to set the completion timeout value for
* 16ms to 55ms
*/
pci_read_config_word(adapter->pdev,
IXGBE_PCI_DEVICE_CONTROL2, &pcie_devctl2);
pcie_devctl2 |= IXGBE_PCI_DEVICE_CONTROL2_16ms;
pci_write_config_word(adapter->pdev,
IXGBE_PCI_DEVICE_CONTROL2, pcie_devctl2);
out:
/* disable completion timeout resend */
gcr &= ~IXGBE_GCR_CMPL_TMOUT_RESEND;
IXGBE_WRITE_REG(hw, IXGBE_GCR, gcr);
}

/**
* ixgbe_get_pcie_msix_count_82598 - Gets MSI-X vector count
* @hw: pointer to hardware structure
Expand Down Expand Up @@ -197,26 +152,6 @@ s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw)
return ret_val;
}

/**
* ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx
* @hw: pointer to hardware structure
*
* Starts the hardware using the generic start_hw function.
* Then set pcie completion timeout
**/
s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw)
{
s32 ret_val = 0;

ret_val = ixgbe_start_hw_generic(hw);

/* set the completion timeout for interface */
if (ret_val == 0)
ixgbe_set_pcie_completion_timeout(hw);

return ret_val;
}

/**
* ixgbe_get_link_capabilities_82598 - Determines link capabilities
* @hw: pointer to hardware structure
Expand Down Expand Up @@ -1150,7 +1085,7 @@ static u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw)
static struct ixgbe_mac_operations mac_ops_82598 = {
.init_hw = &ixgbe_init_hw_generic,
.reset_hw = &ixgbe_reset_hw_82598,
.start_hw = &ixgbe_start_hw_82598,
.start_hw = &ixgbe_start_hw_generic,
.clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic,
.get_media_type = &ixgbe_get_media_type_82598,
.get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82598,
Expand Down
8 changes: 0 additions & 8 deletions trunk/drivers/net/ixgbe/ixgbe_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,6 @@
#define IXGBE_ECC_STATUS_82599 0x110E0
#define IXGBE_BAR_CTRL_82599 0x110F4

/* PCI Express Control */
#define IXGBE_GCR_CMPL_TMOUT_MASK 0x0000F000
#define IXGBE_GCR_CMPL_TMOUT_10ms 0x00001000
#define IXGBE_GCR_CMPL_TMOUT_RESEND 0x00010000
#define IXGBE_GCR_CAP_VER2 0x00040000

/* Time Sync Registers */
#define IXGBE_TSYNCRXCTL 0x05188 /* Rx Time Sync Control register - RW */
#define IXGBE_TSYNCTXCTL 0x08C00 /* Tx Time Sync Control register - RW */
Expand Down Expand Up @@ -1527,7 +1521,6 @@

/* PCI Bus Info */
#define IXGBE_PCI_LINK_STATUS 0xB2
#define IXGBE_PCI_DEVICE_CONTROL2 0xC8
#define IXGBE_PCI_LINK_WIDTH 0x3F0
#define IXGBE_PCI_LINK_WIDTH_1 0x10
#define IXGBE_PCI_LINK_WIDTH_2 0x20
Expand All @@ -1538,7 +1531,6 @@
#define IXGBE_PCI_LINK_SPEED_5000 0x2
#define IXGBE_PCI_HEADER_TYPE_REGISTER 0x0E
#define IXGBE_PCI_HEADER_TYPE_MULTIFUNC 0x80
#define IXGBE_PCI_DEVICE_CONTROL2_16ms 0x0005

/* Number of 100 microseconds we wait for PCI Express master disable */
#define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800
Expand Down
14 changes: 1 addition & 13 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,8 +1488,6 @@ static int sky2_up(struct net_device *dev)
sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
#endif

sky2->restarting = 0;

err = sky2_rx_start(sky2);
if (err)
goto err_out;
Expand All @@ -1502,9 +1500,6 @@ static int sky2_up(struct net_device *dev)

sky2_set_multicast(dev);

/* wake queue incase we are restarting */
netif_wake_queue(dev);

if (netif_msg_ifup(sky2))
printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
return 0;
Expand Down Expand Up @@ -1538,8 +1533,6 @@ static inline int tx_dist(unsigned tail, unsigned head)
/* Number of list elements available for next tx */
static inline int tx_avail(const struct sky2_port *sky2)
{
if (unlikely(sky2->restarting))
return 0;
return sky2->tx_pending - tx_dist(sky2->tx_cons, sky2->tx_prod);
}

Expand Down Expand Up @@ -1825,10 +1818,6 @@ static int sky2_down(struct net_device *dev)
if (netif_msg_ifdown(sky2))
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);

/* explicitly shut off tx incase we're restarting */
sky2->restarting = 1;
netif_tx_disable(dev);

/* Force flow control off */
sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);

Expand Down Expand Up @@ -2370,7 +2359,7 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
{
struct sky2_port *sky2 = netdev_priv(dev);

if (likely(netif_running(dev) && !sky2->restarting)) {
if (netif_running(dev)) {
netif_tx_lock(dev);
sky2_tx_complete(sky2, last);
netif_tx_unlock(dev);
Expand Down Expand Up @@ -4294,7 +4283,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
spin_lock_init(&sky2->phy_lock);
sky2->tx_pending = TX_DEF_PENDING;
sky2->rx_pending = RX_DEF_PENDING;
sky2->restarting = 0;

hw->dev[port] = dev;

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/sky2.h
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,6 @@ struct sky2_port {
u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */
u8 rx_csum;
u8 wol;
u8 restarting;
enum flow_control flow_mode;
enum flow_control flow_status;

Expand Down
12 changes: 1 addition & 11 deletions trunk/include/net/bluetooth/rfcomm.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,7 @@ struct rfcomm_dev_list_req {
};

int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg);

#ifdef CONFIG_BT_RFCOMM_TTY
int rfcomm_init_ttys(void);
void rfcomm_cleanup_ttys(void);
#else
static inline int rfcomm_init_ttys(void)
{
return 0;
}
static inline void rfcomm_cleanup_ttys(void)
{
}
#endif

#endif /* __RFCOMM_H */
27 changes: 8 additions & 19 deletions trunk/net/bluetooth/rfcomm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2080,41 +2080,28 @@ static CLASS_ATTR(rfcomm_dlc, S_IRUGO, rfcomm_dlc_sysfs_show, NULL);
/* ---- Initialization ---- */
static int __init rfcomm_init(void)
{
int ret;

l2cap_load();

hci_register_cb(&rfcomm_cb);

rfcomm_thread = kthread_run(rfcomm_run, NULL, "krfcommd");
if (IS_ERR(rfcomm_thread)) {
ret = PTR_ERR(rfcomm_thread);
goto out_thread;
hci_unregister_cb(&rfcomm_cb);
return PTR_ERR(rfcomm_thread);
}

if (class_create_file(bt_class, &class_attr_rfcomm_dlc) < 0)
BT_ERR("Failed to create RFCOMM info file");

ret = rfcomm_init_ttys();
if (ret)
goto out_tty;
rfcomm_init_sockets();

ret = rfcomm_init_sockets();
if (ret)
goto out_sock;
#ifdef CONFIG_BT_RFCOMM_TTY
rfcomm_init_ttys();
#endif

BT_INFO("RFCOMM ver %s", VERSION);

return 0;

out_sock:
rfcomm_cleanup_ttys();
out_tty:
kthread_stop(rfcomm_thread);
out_thread:
hci_unregister_cb(&rfcomm_cb);

return ret;
}

static void __exit rfcomm_exit(void)
Expand All @@ -2125,7 +2112,9 @@ static void __exit rfcomm_exit(void)

kthread_stop(rfcomm_thread);

#ifdef CONFIG_BT_RFCOMM_TTY
rfcomm_cleanup_ttys();
#endif

rfcomm_cleanup_sockets();
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/bluetooth/rfcomm/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ int __init rfcomm_init_sockets(void)
return err;
}

void rfcomm_cleanup_sockets(void)
void __exit rfcomm_cleanup_sockets(void)
{
class_remove_file(bt_class, &class_attr_rfcomm);

Expand Down
4 changes: 3 additions & 1 deletion trunk/net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int cmp_ies(u8 num, u8 *ies1, size_t len1, u8 *ies2, size_t len2)

if (!ie1 && !ie2)
return 0;
if (!ie1)
if (!ie1 || !ie2)
return -1;

r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1]));
Expand Down Expand Up @@ -171,6 +171,8 @@ static bool is_mesh(struct cfg80211_bss *a,
ie = find_ie(WLAN_EID_MESH_CONFIG,
a->information_elements,
a->len_information_elements);
if (!ie)
return false;
if (ie[1] != IEEE80211_MESH_CONFIG_LEN)
return false;

Expand Down

0 comments on commit b9fecca

Please sign in to comment.