Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  amd8111e: Fix rx return code
  pktgen: fix multiple queue warning
  mac80211.h: fix kernel-doc excesses
  p54: fix build warnings
  ath5k: Reset key cache on interface up, thus fixing resume
  mac80211: correct warnings in minstrel rate control algorithm
  RFKILL: fix input layer initialisation
  p54: fix misbehavings when firmware can't be found
  dm9601: runtime mac address change support
  via-velocity: use driver string instead of dev->name before register_netdev()
  drivers/net/wan/syncppp: Fix unused-var warnings
  mlx4: Setting the correct offset for default mac address
  mlx4_en: remove duplicated #include
  ibm_newemac: Fix typo in flow control config option
  ehea: Detect 16GB hugepages for firmware restriction
  dmfe: check pci_alloc_consistent errors
  qeth: avoid skb_under_panic for malformatted inbound data
  qeth: remove unnecessary support ckeck in sysfs route6
  qeth: fix offset error in non prealloc header path
  qeth: remove non-recover-thread checkings
  • Loading branch information
Linus Torvalds committed Oct 30, 2008
2 parents 4ac08d3 + 48e5eca commit 3a7029d
Show file tree
Hide file tree
Showing 22 changed files with 220 additions and 173 deletions.
14 changes: 8 additions & 6 deletions drivers/net/amd8111e.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,12 +833,14 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget)

} while(intr0 & RINT0);

/* Receive descriptor is empty now */
spin_lock_irqsave(&lp->lock, flags);
__netif_rx_complete(dev, napi);
writel(VAL0|RINTEN0, mmio + INTEN0);
writel(VAL2 | RDMD0, mmio + CMD0);
spin_unlock_irqrestore(&lp->lock, flags);
if (rx_pkt_limit > 0) {
/* Receive descriptor is empty now */
spin_lock_irqsave(&lp->lock, flags);
__netif_rx_complete(dev, napi);
writel(VAL0|RINTEN0, mmio + INTEN0);
writel(VAL2 | RDMD0, mmio + CMD0);
spin_unlock_irqrestore(&lp->lock, flags);
}

rx_not_empty:
return num_rx_pkt;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0094"
#define DRV_VERSION "EHEA_0095"

/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
Expand Down
57 changes: 52 additions & 5 deletions drivers/net/ehea/ehea_qmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,18 +632,21 @@ static void ehea_rebuild_busmap(void)
}
}

static int ehea_update_busmap(unsigned long pfn, unsigned long pgnum, int add)
static int ehea_update_busmap(unsigned long pfn, unsigned long nr_pages, int add)
{
unsigned long i, start_section, end_section;

if (!nr_pages)
return 0;

if (!ehea_bmap) {
ehea_bmap = kzalloc(sizeof(struct ehea_bmap), GFP_KERNEL);
if (!ehea_bmap)
return -ENOMEM;
}

start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE;
end_section = start_section + ((pgnum * PAGE_SIZE) / EHEA_SECTSIZE);
end_section = start_section + ((nr_pages * PAGE_SIZE) / EHEA_SECTSIZE);
/* Mark entries as valid or invalid only; address is assigned later */
for (i = start_section; i < end_section; i++) {
u64 flag;
Expand Down Expand Up @@ -692,10 +695,54 @@ int ehea_rem_sect_bmap(unsigned long pfn, unsigned long nr_pages)
return ret;
}

static int ehea_create_busmap_callback(unsigned long pfn,
unsigned long nr_pages, void *arg)
static int ehea_is_hugepage(unsigned long pfn)
{
int page_order;

if (pfn & EHEA_HUGEPAGE_PFN_MASK)
return 0;

page_order = compound_order(pfn_to_page(pfn));
if (page_order + PAGE_SHIFT != EHEA_HUGEPAGESHIFT)
return 0;

return 1;
}

static int ehea_create_busmap_callback(unsigned long initial_pfn,
unsigned long total_nr_pages, void *arg)
{
return ehea_update_busmap(pfn, nr_pages, EHEA_BUSMAP_ADD_SECT);
int ret;
unsigned long pfn, start_pfn, end_pfn, nr_pages;

if ((total_nr_pages * PAGE_SIZE) < EHEA_HUGEPAGE_SIZE)
return ehea_update_busmap(initial_pfn, total_nr_pages,
EHEA_BUSMAP_ADD_SECT);

/* Given chunk is >= 16GB -> check for hugepages */
start_pfn = initial_pfn;
end_pfn = initial_pfn + total_nr_pages;
pfn = start_pfn;

while (pfn < end_pfn) {
if (ehea_is_hugepage(pfn)) {
/* Add mem found in front of the hugepage */
nr_pages = pfn - start_pfn;
ret = ehea_update_busmap(start_pfn, nr_pages,
EHEA_BUSMAP_ADD_SECT);
if (ret)
return ret;

/* Skip the hugepage */
pfn += (EHEA_HUGEPAGE_SIZE / PAGE_SIZE);
start_pfn = pfn;
} else
pfn += (EHEA_SECTSIZE / PAGE_SIZE);
}

/* Add mem found behind the hugepage(s) */
nr_pages = pfn - start_pfn;
return ehea_update_busmap(start_pfn, nr_pages, EHEA_BUSMAP_ADD_SECT);
}

int ehea_create_busmap(void)
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ehea/ehea_qmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#define EHEA_PAGESIZE (1UL << EHEA_PAGESHIFT)
#define EHEA_SECTSIZE (1UL << 24)
#define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> EHEA_PAGESHIFT)
#define EHEA_HUGEPAGESHIFT 34
#define EHEA_HUGEPAGE_SIZE (1UL << EHEA_HUGEPAGESHIFT)
#define EHEA_HUGEPAGE_PFN_MASK ((EHEA_HUGEPAGE_SIZE - 1) >> PAGE_SHIFT)

#if ((1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE)
#error eHEA module cannot work if kernel sectionsize < ehea sectionsize
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ibm_newemac/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,7 @@ static int __devinit emac_init_config(struct emac_instance *dev)
of_device_is_compatible(np, "ibm,emac-440gr"))
dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX;
if (of_device_is_compatible(np, "ibm,emac-405ez")) {
#ifdef CONFIG_IBM_NEW_EMAC_NO_FLOW_CONTROL
#ifdef CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL
dev->features |= EMAC_FTR_NO_FLOW_CONTROL_40x;
#else
printk(KERN_ERR "%s: Flow control not disabled!\n",
Expand Down
1 change: 0 additions & 1 deletion drivers/net/mlx4/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/cpumask.h>

#include <linux/mlx4/driver.h>
#include <linux/mlx4/device.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/mlx4/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
#define QUERY_PORT_ETH_MTU_OFFSET 0x02
#define QUERY_PORT_WIDTH_OFFSET 0x06
#define QUERY_PORT_MAX_GID_PKEY_OFFSET 0x07
#define QUERY_PORT_MAC_OFFSET 0x08
#define QUERY_PORT_MAX_MACVLAN_OFFSET 0x0a
#define QUERY_PORT_MAX_VL_OFFSET 0x0b
#define QUERY_PORT_MAC_OFFSET 0x10

for (i = 1; i <= dev_cap->num_ports; ++i) {
err = mlx4_cmd_box(dev, 0, mailbox->dma, i, 0, MLX4_CMD_QUERY_PORT,
Expand Down
12 changes: 11 additions & 1 deletion drivers/net/tulip/dmfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,13 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
/* Allocate Tx/Rx descriptor memory */
db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) *
DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr);
if (!db->desc_pool_ptr)
goto err_out_res;

db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC *
TX_DESC_CNT + 4, &db->buf_pool_dma_ptr);
if (!db->buf_pool_ptr)
goto err_out_free_desc;

db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr;
db->first_tx_desc_dma = db->desc_pool_dma_ptr;
Expand Down Expand Up @@ -469,7 +473,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,

err = register_netdev (dev);
if (err)
goto err_out_res;
goto err_out_free_buf;

printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, "
"%s, irq %d.\n",
Expand All @@ -483,6 +487,12 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,

return 0;

err_out_free_buf:
pci_free_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4,
db->buf_pool_ptr, db->buf_pool_dma_ptr);
err_out_free_desc:
pci_free_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20,
db->desc_pool_ptr, db->desc_pool_dma_ptr);
err_out_res:
pci_release_regions(pdev);
err_out_disable:
Expand Down
15 changes: 15 additions & 0 deletions drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,20 @@ static void dm9601_set_multicast(struct net_device *net)
dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl);
}

static int dm9601_set_mac_address(struct net_device *net, void *p)
{
struct sockaddr *addr = p;
struct usbnet *dev = netdev_priv(net);

if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;

memcpy(net->dev_addr, addr->sa_data, net->addr_len);
dm_write_async(dev, DM_PHY_ADDR, net->addr_len, net->dev_addr);

return 0;
}

static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret;
Expand All @@ -406,6 +420,7 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)

dev->net->do_ioctl = dm9601_ioctl;
dev->net->set_multicast_list = dm9601_set_multicast;
dev->net->set_mac_address = dm9601_set_mac_address;
dev->net->ethtool_ops = &dm9601_ethtool_ops;
dev->net->hard_header_len += DM_TX_OVERHEAD;
dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
Expand Down
11 changes: 7 additions & 4 deletions drivers/net/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ static void __devexit velocity_remove1(struct pci_dev *pdev)
* we don't duplicate code for each option.
*/

static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, char *devname)
static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, const char *devname)
{
if (val == -1)
*opt = def;
Expand Down Expand Up @@ -550,7 +550,7 @@ static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max,
* we don't duplicate code for each option.
*/

static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, char *devname)
static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, const char *devname)
{
(*opt) &= (~flag);
if (val == -1)
Expand All @@ -576,7 +576,7 @@ static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 fla
* for the current device
*/

static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname)
static void __devinit velocity_get_options(struct velocity_opt *opts, int index, const char *devname)
{

velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname);
Expand Down Expand Up @@ -863,6 +863,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
static int first = 1;
struct net_device *dev;
int i;
const char *drv_string;
const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data];
struct velocity_info *vptr;
struct mac_regs __iomem * regs;
Expand Down Expand Up @@ -935,7 +936,9 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
dev->dev_addr[i] = readb(&regs->PAR[i]);


velocity_get_options(&vptr->options, velocity_nics, dev->name);
drv_string = dev_driver_string(&pdev->dev);

velocity_get_options(&vptr->options, velocity_nics, drv_string);

/*
* Mask out the options cannot be set to the chip
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wan/syncppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,11 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb)
case CISCO_ADDR_REQ:
/* Stolen from net/ipv4/devinet.c -- SIOCGIFADDR ioctl */
{
struct in_device *in_dev;
struct in_ifaddr *ifa;
__be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */
#ifdef CONFIG_INET
struct in_device *in_dev;
struct in_ifaddr *ifa;

rcu_read_lock();
if ((in_dev = __in_dev_get_rcu(dev)) != NULL)
{
Expand Down
33 changes: 11 additions & 22 deletions drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,7 @@ ath5k_pci_resume(struct pci_dev *pdev)
{
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath5k_softc *sc = hw->priv;
struct ath5k_hw *ah = sc->ah;
int i, err;
int err;

pci_restore_state(pdev);

Expand All @@ -688,16 +687,6 @@ ath5k_pci_resume(struct pci_dev *pdev)
goto err_irq;
ath5k_led_enable(sc);

/*
* Reset the key cache since some parts do not
* reset the contents on initial power up or resume.
*
* FIXME: This may need to be revisited when mac80211 becomes
* aware of suspend/resume.
*/
for (i = 0; i < AR5K_KEYTABLE_SIZE; i++)
ath5k_hw_reset_key(ah, i);

return 0;
err_irq:
free_irq(pdev->irq, sc);
Expand All @@ -718,7 +707,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
struct ath5k_softc *sc = hw->priv;
struct ath5k_hw *ah = sc->ah;
u8 mac[ETH_ALEN];
unsigned int i;
int ret;

ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device);
Expand All @@ -736,13 +724,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
if (ret > 0)
__set_bit(ATH_STAT_MRRETRY, sc->status);

/*
* Reset the key cache since some parts do not
* reset the contents on initial power up.
*/
for (i = 0; i < AR5K_KEYTABLE_SIZE; i++)
ath5k_hw_reset_key(ah, i);

/*
* Collect the channel list. The 802.11 layer
* is resposible for filtering this list based
Expand Down Expand Up @@ -2202,7 +2183,8 @@ ath5k_beacon_config(struct ath5k_softc *sc)
static int
ath5k_init(struct ath5k_softc *sc, bool is_resume)
{
int ret;
struct ath5k_hw *ah = sc->ah;
int ret, i;

mutex_lock(&sc->lock);

Expand Down Expand Up @@ -2235,10 +2217,17 @@ ath5k_init(struct ath5k_softc *sc, bool is_resume)
if (ret)
goto done;

/*
* Reset the key cache since some parts do not reset the
* contents on initial power up or resume from suspend.
*/
for (i = 0; i < AR5K_KEYTABLE_SIZE; i++)
ath5k_hw_reset_key(ah, i);

__set_bit(ATH_STAT_STARTED, sc->status);

/* Set ack to be sent at low bit-rates */
ath5k_hw_set_ack_bitrate_high(sc->ah, false);
ath5k_hw_set_ack_bitrate_high(ah, false);

mod_timer(&sc->calib_tim, round_jiffies(jiffies +
msecs_to_jiffies(ath5k_calinterval * 1000)));
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wireless/p54/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
void *tmp;
int err;
u8 *end = (u8 *)eeprom + len;
u16 synth;
u16 synth = 0;
DECLARE_MAC_BUF(mac);

wrap = (struct eeprom_pda_wrap *) eeprom;
Expand Down Expand Up @@ -422,7 +422,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
entry = (void *)entry + (entry_len + 1)*2;
}

if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) {
if (!synth || !priv->iq_autocal || !priv->output_limit ||
!priv->curve_data) {
printk(KERN_ERR "p54: not all required entries found in eeprom!\n");
err = -EINVAL;
goto err;
Expand Down
Loading

0 comments on commit 3a7029d

Please sign in to comment.