Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255960
b: refs/heads/master
c: 85a43a9
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jun 27, 2011
1 parent 7b92190 commit 71160a2
Show file tree
Hide file tree
Showing 30 changed files with 642 additions and 695 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: 42532da64e9c4102decab8f37cf3959af55789a4
refs/heads/master: 85a43a9edaf5b541381acbf4061bace1121d6ef0
42 changes: 21 additions & 21 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ module_param(num_vfs, uint, S_IRUGO);
MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data.");
MODULE_PARM_DESC(num_vfs, "Number of PCI VFs to initialize");

static bool multi_rxq = true;
module_param(multi_rxq, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(multi_rxq, "Multi Rx Queue support. Enabled by default");

static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
{ PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) },
{ PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID2) },
Expand Down Expand Up @@ -428,33 +424,38 @@ void netdev_stats_update(struct be_adapter *adapter)
struct net_device_stats *dev_stats = &adapter->netdev->stats;
struct be_rx_obj *rxo;
struct be_tx_obj *txo;
unsigned long pkts = 0, bytes = 0, mcast = 0, drops = 0;
int i;

memset(dev_stats, 0, sizeof(*dev_stats));
for_all_rx_queues(adapter, rxo, i) {
dev_stats->rx_packets += rx_stats(rxo)->rx_pkts;
dev_stats->rx_bytes += rx_stats(rxo)->rx_bytes;
dev_stats->multicast += rx_stats(rxo)->rx_mcast_pkts;
pkts += rx_stats(rxo)->rx_pkts;
bytes += rx_stats(rxo)->rx_bytes;
mcast += rx_stats(rxo)->rx_mcast_pkts;
/* no space in linux buffers: best possible approximation */
if (adapter->generation == BE_GEN3) {
if (!(lancer_chip(adapter))) {
struct be_erx_stats_v1 *erx_stats =
struct be_erx_stats_v1 *erx =
be_erx_stats_from_cmd(adapter);
dev_stats->rx_dropped +=
erx_stats->rx_drops_no_fragments[rxo->q.id];
drops += erx->rx_drops_no_fragments[rxo->q.id];
}
} else {
struct be_erx_stats_v0 *erx_stats =
struct be_erx_stats_v0 *erx =
be_erx_stats_from_cmd(adapter);
dev_stats->rx_dropped +=
erx_stats->rx_drops_no_fragments[rxo->q.id];
drops += erx->rx_drops_no_fragments[rxo->q.id];
}
}
dev_stats->rx_packets = pkts;
dev_stats->rx_bytes = bytes;
dev_stats->multicast = mcast;
dev_stats->rx_dropped = drops;

pkts = bytes = 0;
for_all_tx_queues(adapter, txo, i) {
dev_stats->tx_packets += tx_stats(txo)->be_tx_pkts;
dev_stats->tx_bytes += tx_stats(txo)->be_tx_bytes;
pkts += tx_stats(txo)->be_tx_pkts;
bytes += tx_stats(txo)->be_tx_bytes;
}
dev_stats->tx_packets = pkts;
dev_stats->tx_bytes = bytes;

/* bad pkts received */
dev_stats->rx_errors = drvs->rx_crc_errors +
Expand Down Expand Up @@ -1780,7 +1781,7 @@ static void be_rx_queues_destroy(struct be_adapter *adapter)

static u32 be_num_rxqs_want(struct be_adapter *adapter)
{
if (multi_rxq && (adapter->function_caps & BE_FUNCTION_CAPS_RSS) &&
if ((adapter->function_caps & BE_FUNCTION_CAPS_RSS) &&
!adapter->sriov_enabled && !(adapter->function_mode & 0x400)) {
return 1 + MAX_RSS_QS; /* one default non-RSS queue */
} else {
Expand Down Expand Up @@ -2553,6 +2554,9 @@ static int be_setup(struct be_adapter *adapter)
if (status != 0)
goto tx_qs_destroy;

/* Allow all priorities by default. A GRP5 evt may modify this */
adapter->vlan_prio_bmap = 0xff;

status = be_mcc_queues_create(adapter);
if (status != 0)
goto rx_qs_destroy;
Expand Down Expand Up @@ -3418,10 +3422,6 @@ static int __devinit be_probe(struct pci_dev *pdev,
}

dev_info(&pdev->dev, "%s port %d\n", nic_name(pdev), adapter->port_num);
/* By default all priorities are enabled.
* Needed in case of no GRP5 evt support
*/
adapter->vlan_prio_bmap = 0xff;

schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
return 0;
Expand Down
30 changes: 15 additions & 15 deletions trunk/drivers/net/wan/c101.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* Moxa C101 User's Manual
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/capability.h>
Expand Down Expand Up @@ -313,44 +315,44 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
int result;

if (irq<3 || irq>15 || irq == 6) /* FIXME */ {
printk(KERN_ERR "c101: invalid IRQ value\n");
pr_err("invalid IRQ value\n");
return -ENODEV;
}

if (winbase < 0xC0000 || winbase > 0xDFFFF || (winbase & 0x3FFF) !=0) {
printk(KERN_ERR "c101: invalid RAM value\n");
pr_err("invalid RAM value\n");
return -ENODEV;
}

card = kzalloc(sizeof(card_t), GFP_KERNEL);
if (card == NULL) {
printk(KERN_ERR "c101: unable to allocate memory\n");
pr_err("unable to allocate memory\n");
return -ENOBUFS;
}

card->dev = alloc_hdlcdev(card);
if (!card->dev) {
printk(KERN_ERR "c101: unable to allocate memory\n");
pr_err("unable to allocate memory\n");
kfree(card);
return -ENOBUFS;
}

if (request_irq(irq, sca_intr, 0, devname, card)) {
printk(KERN_ERR "c101: could not allocate IRQ\n");
pr_err("could not allocate IRQ\n");
c101_destroy_card(card);
return -EBUSY;
}
card->irq = irq;

if (!request_mem_region(winbase, C101_MAPPED_RAM_SIZE, devname)) {
printk(KERN_ERR "c101: could not request RAM window\n");
pr_err("could not request RAM window\n");
c101_destroy_card(card);
return -EBUSY;
}
card->phy_winbase = winbase;
card->win0base = ioremap(winbase, C101_MAPPED_RAM_SIZE);
if (!card->win0base) {
printk(KERN_ERR "c101: could not map I/O address\n");
pr_err("could not map I/O address\n");
c101_destroy_card(card);
return -EFAULT;
}
Expand Down Expand Up @@ -381,18 +383,16 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)

result = register_hdlc_device(dev);
if (result) {
printk(KERN_WARNING "c101: unable to register hdlc device\n");
pr_warn("unable to register hdlc device\n");
c101_destroy_card(card);
return result;
}

sca_init_port(card); /* Set up C101 memory */
set_carrier(card);

printk(KERN_INFO "%s: Moxa C101 on IRQ%u,"
" using %u TX + %u RX packets rings\n",
dev->name, card->irq,
card->tx_ring_buffers, card->rx_ring_buffers);
netdev_info(dev, "Moxa C101 on IRQ%u, using %u TX + %u RX packets rings\n",
card->irq, card->tx_ring_buffers, card->rx_ring_buffers);

*new_card = card;
new_card = &card->next_card;
Expand All @@ -405,12 +405,12 @@ static int __init c101_init(void)
{
if (hw == NULL) {
#ifdef MODULE
printk(KERN_INFO "c101: no card initialized\n");
pr_info("no card initialized\n");
#endif
return -EINVAL; /* no parameters specified, abort */
}

printk(KERN_INFO "%s\n", version);
pr_info("%s\n", version);

do {
unsigned long irq, ram;
Expand All @@ -428,7 +428,7 @@ static int __init c101_init(void)
return first_card ? 0 : -EINVAL;
}while(*hw++ == ':');

printk(KERN_ERR "c101: invalid hardware parameters\n");
pr_err("invalid hardware parameters\n");
return first_card ? 0 : -EINVAL;
}

Expand Down
Loading

0 comments on commit 71160a2

Please sign in to comment.