Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203943
b: refs/heads/master
c: ae3568a
h: refs/heads/master
i:
  203941: edce5e2
  203939: acc99b7
  203935: 1f05233
v: v3
  • Loading branch information
John W. Linville committed Jul 29, 2010
1 parent a0318f5 commit 2162628
Show file tree
Hide file tree
Showing 111 changed files with 14,612 additions and 12,575 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: b7753c8cd51dce67a0b152efb456a21ff1cc241b
refs/heads/master: ae3568adf42d5d3bb3cfa505b94351c5d1ce4924
2 changes: 1 addition & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
M: Eilon Greenstein <eilong@broadcom.com>
L: netdev@vger.kernel.org
S: Supported
F: drivers/net/bnx2x*
F: drivers/net/bnx2x/

BROADCOM TG3 GIGABIT ETHERNET DRIVER
M: Matt Carlson <mcarlson@broadcom.com>
Expand Down
10 changes: 2 additions & 8 deletions trunk/arch/um/drivers/net_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
#include "net_kern.h"
#include "net_user.h"

static inline void set_ether_mac(struct net_device *dev, unsigned char *addr)
{
memcpy(dev->dev_addr, addr, ETH_ALEN);
}

#define DRIVER_NAME "uml-netdev"

static DEFINE_SPINLOCK(opened_lock);
Expand Down Expand Up @@ -266,7 +261,7 @@ static int uml_net_set_mac(struct net_device *dev, void *addr)
struct sockaddr *hwaddr = addr;

spin_lock_irq(&lp->lock);
set_ether_mac(dev, hwaddr->sa_data);
eth_mac_addr(dev, hwaddr->sa_data);
spin_unlock_irq(&lp->lock);

return 0;
Expand Down Expand Up @@ -380,7 +375,6 @@ static const struct net_device_ops uml_netdev_ops = {
.ndo_tx_timeout = uml_net_tx_timeout,
.ndo_set_mac_address = uml_net_set_mac,
.ndo_change_mtu = uml_net_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
};

Expand Down Expand Up @@ -478,7 +472,7 @@ static void eth_configure(int n, void *init, char *mac,
((*transport->user->init)(&lp->user, dev) != 0))
goto out_unregister;

set_ether_mac(dev, device->mac);
eth_mac_addr(dev, device->mac);
dev->mtu = transport->user->mtu;
dev->netdev_ops = &uml_netdev_ops;
dev->ethtool_ops = &uml_net_ethtool_ops;
Expand Down
15 changes: 2 additions & 13 deletions trunk/drivers/atm/nicstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ static void which_list(ns_dev * card, struct sk_buff *skb);
#endif
static void ns_poll(unsigned long arg);
static int ns_parse_mac(char *mac, unsigned char *esi);
static short ns_h2i(char c);
static void ns_phy_put(struct atm_dev *dev, unsigned char value,
unsigned long addr);
static unsigned char ns_phy_get(struct atm_dev *dev, unsigned long addr);
Expand Down Expand Up @@ -2824,9 +2823,9 @@ static int ns_parse_mac(char *mac, unsigned char *esi)
return -1;
j = 0;
for (i = 0; i < 6; i++) {
if ((byte1 = ns_h2i(mac[j++])) < 0)
if ((byte1 = hex_to_bin(mac[j++])) < 0)
return -1;
if ((byte0 = ns_h2i(mac[j++])) < 0)
if ((byte0 = hex_to_bin(mac[j++])) < 0)
return -1;
esi[i] = (unsigned char)(byte1 * 16 + byte0);
if (i < 5) {
Expand All @@ -2837,16 +2836,6 @@ static int ns_parse_mac(char *mac, unsigned char *esi)
return 0;
}

static short ns_h2i(char c)
{
if (c >= '0' && c <= '9')
return (short)(c - '0');
if (c >= 'A' && c <= 'F')
return (short)(c - 'A' + 10);
if (c >= 'a' && c <= 'f')
return (short)(c - 'a' + 10);
return -1;
}

static void ns_phy_put(struct atm_dev *dev, unsigned char value,
unsigned long addr)
Expand Down
40 changes: 39 additions & 1 deletion trunk/drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,10 +1020,16 @@ static int __devinit vortex_init_one(struct pci_dev *pdev,
ioaddr = pci_iomap(pdev, pci_bar, 0);
if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */
ioaddr = pci_iomap(pdev, 0, 0);
if (!ioaddr) {
pci_disable_device(pdev);
rc = -ENOMEM;
goto out;
}

rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq,
ent->driver_data, unit);
if (rc < 0) {
pci_iounmap(pdev, ioaddr);
pci_disable_device(pdev);
goto out;
}
Expand Down Expand Up @@ -1387,7 +1393,7 @@ static int __devinit vortex_probe1(struct device *gendev,
mii_preamble_required++;
if (vp->drv_flags & EXTRA_PREAMBLE)
mii_preamble_required++;
mdio_sync(ioaddr, 32);
mdio_sync(vp, 32);
mdio_read(dev, 24, MII_BMSR);
for (phy = 0; phy < 32 && phy_idx < 1; phy++) {
int mii_status, phyx;
Expand Down Expand Up @@ -2912,6 +2918,36 @@ static void vortex_get_drvinfo(struct net_device *dev,
}
}

static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct vortex_private *vp = netdev_priv(dev);

spin_lock_irq(&vp->lock);
wol->supported = WAKE_MAGIC;

wol->wolopts = 0;
if (vp->enable_wol)
wol->wolopts |= WAKE_MAGIC;
spin_unlock_irq(&vp->lock);
}

static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct vortex_private *vp = netdev_priv(dev);
if (wol->wolopts & ~WAKE_MAGIC)
return -EINVAL;

spin_lock_irq(&vp->lock);
if (wol->wolopts & WAKE_MAGIC)
vp->enable_wol = 1;
else
vp->enable_wol = 0;
acpi_set_WOL(dev);
spin_unlock_irq(&vp->lock);

return 0;
}

static const struct ethtool_ops vortex_ethtool_ops = {
.get_drvinfo = vortex_get_drvinfo,
.get_strings = vortex_get_strings,
Expand All @@ -2923,6 +2959,8 @@ static const struct ethtool_ops vortex_ethtool_ops = {
.set_settings = vortex_set_settings,
.get_link = ethtool_op_get_link,
.nway_reset = vortex_nway_reset,
.get_wol = vortex_get_wol,
.set_wol = vortex_set_wol,
};

#ifdef CONFIG_PCI
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ obj-$(CONFIG_FEALNX) += fealnx.o
obj-$(CONFIG_TIGON3) += tg3.o
obj-$(CONFIG_BNX2) += bnx2.o
obj-$(CONFIG_CNIC) += cnic.o
obj-$(CONFIG_BNX2X) += bnx2x.o
bnx2x-objs := bnx2x_main.o bnx2x_link.o
obj-$(CONFIG_BNX2X) += bnx2x/
spidernet-y += spider_net.o spider_net_ethtool.o
obj-$(CONFIG_SPIDER_NET) += spidernet.o sungem_phy.o
obj-$(CONFIG_GELIC_NET) += ps3_gelic.o
Expand Down
16 changes: 12 additions & 4 deletions trunk/drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "be_hw.h"

#define DRV_VER "2.102.147u"
#define DRV_VER "2.103.175u"
#define DRV_NAME "be2net"
#define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC"
#define BE3_NAME "ServerEngines BladeEngine3 10Gbps NIC"
Expand Down Expand Up @@ -220,7 +220,16 @@ struct be_rx_obj {
struct be_rx_page_info page_info_tbl[RX_Q_LEN];
};

struct be_vf_cfg {
unsigned char vf_mac_addr[ETH_ALEN];
u32 vf_if_handle;
u32 vf_pmac_id;
u16 vf_vlan_tag;
u32 vf_tx_rate;
};

#define BE_NUM_MSIX_VECTORS 2 /* 1 each for Tx and Rx */
#define BE_INVALID_PMAC_ID 0xffffffff
struct be_adapter {
struct pci_dev *pdev;
struct net_device *netdev;
Expand Down Expand Up @@ -276,7 +285,7 @@ struct be_adapter {
u32 port_num;
bool promiscuous;
bool wol;
u32 cap;
u32 function_mode;
u32 rx_fc; /* Rx flow control */
u32 tx_fc; /* Tx flow control */
int link_speed;
Expand All @@ -288,8 +297,7 @@ struct be_adapter {
struct completion flash_compl;

bool sriov_enabled;
u32 vf_if_handle[BE_MAX_VF];
u32 vf_pmac_id[BE_MAX_VF];
struct be_vf_cfg vf_cfg[BE_MAX_VF];
u8 base_eq_id;
u8 is_virtfn;
};
Expand Down
40 changes: 37 additions & 3 deletions trunk/drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
sizeof(resp->hw_stats));
netdev_stats_update(adapter);
}
} else if (compl_status != MCC_STATUS_NOT_SUPPORTED) {
} else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) &&
(compl->tag0 != OPCODE_COMMON_NTWK_MAC_QUERY)) {
extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) &
CQE_STATUS_EXTD_MASK;
dev_warn(&adapter->pdev->dev,
Expand Down Expand Up @@ -1257,7 +1258,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc)
}

/* Uses mbox */
int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, u32 *cap)
int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, u32 *mode)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_query_fw_cfg *req;
Expand All @@ -1278,7 +1279,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, u32 *cap)
if (!status) {
struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb);
*port_num = le32_to_cpu(resp->phys_port);
*cap = le32_to_cpu(resp->function_cap);
*mode = le32_to_cpu(resp->function_mode);
}

spin_unlock(&adapter->mbox_lock);
Expand Down Expand Up @@ -1730,3 +1731,36 @@ int be_cmd_get_phy_info(struct be_adapter *adapter, struct be_dma_mem *cmd)
spin_unlock_bh(&adapter->mcc_lock);
return status;
}

int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_set_qos *req;
int status;

spin_lock_bh(&adapter->mcc_lock);

wrb = wrb_from_mccq(adapter);
if (!wrb) {
status = -EBUSY;
goto err;
}

req = embedded_payload(wrb);

be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
OPCODE_COMMON_SET_QOS);

be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_SET_QOS, sizeof(*req));

req->hdr.domain = domain;
req->valid_bits = BE_QOS_BITS_NIC;
req->max_bps_nic = bps;

status = be_mcc_notify_wait(adapter);

err:
spin_unlock_bh(&adapter->mcc_lock);
return status;
}
20 changes: 19 additions & 1 deletion trunk/drivers/net/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_CQ_CREATE 12
#define OPCODE_COMMON_EQ_CREATE 13
#define OPCODE_COMMON_MCC_CREATE 21
#define OPCODE_COMMON_SET_QOS 28
#define OPCODE_COMMON_SEEPROM_READ 30
#define OPCODE_COMMON_NTWK_RX_FILTER 34
#define OPCODE_COMMON_GET_FW_VERSION 35
Expand Down Expand Up @@ -748,7 +749,7 @@ struct be_cmd_resp_query_fw_cfg {
u32 be_config_number;
u32 asic_revision;
u32 phys_port;
u32 function_cap;
u32 function_mode;
u32 rsvd[26];
};

Expand Down Expand Up @@ -894,6 +895,22 @@ struct be_cmd_resp_get_phy_info {
u32 future_use[4];
};

/*********************** Set QOS ***********************/

#define BE_QOS_BITS_NIC 1

struct be_cmd_req_set_qos {
struct be_cmd_req_hdr hdr;
u32 valid_bits;
u32 max_bps_nic;
u32 rsvd[7];
};

struct be_cmd_resp_set_qos {
struct be_cmd_resp_hdr hdr;
u32 rsvd;
};

extern int be_pci_fnum_get(struct be_adapter *adapter);
extern int be_cmd_POST(struct be_adapter *adapter);
extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
Expand Down Expand Up @@ -974,4 +991,5 @@ extern int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
u8 loopback_type, u8 enable);
extern int be_cmd_get_phy_info(struct be_adapter *adapter,
struct be_dma_mem *cmd);
extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain);

Loading

0 comments on commit 2162628

Please sign in to comment.