Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314556
b: refs/heads/master
c: 3e428fe
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jun 21, 2012
1 parent 576a070 commit b833cf4
Show file tree
Hide file tree
Showing 15 changed files with 330 additions and 191 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: 9cfc7bd608b97463993b4f3e4775d99022253f8d
refs/heads/master: 3e428fe0382fca48795b5cf9d4f03a89cda5d84d
29 changes: 7 additions & 22 deletions trunk/drivers/net/can/c_can/c_can_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/clk.h>
#include <linux/pci.h>

#include <linux/can/dev.h>
Expand All @@ -30,7 +29,7 @@ struct c_can_pci_data {
enum c_can_dev_id type;
/* Set the register alignment in the memory */
enum c_can_pci_reg_align reg_align;
/* Set the frequency if clk is not usable */
/* Set the frequency */
unsigned int freq;
};

Expand Down Expand Up @@ -71,7 +70,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
struct c_can_priv *priv;
struct net_device *dev;
void __iomem *addr;
struct clk *clk;
int ret;

ret = pci_enable_device(pdev);
Expand Down Expand Up @@ -113,18 +111,11 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
priv->base = addr;

if (!c_can_pci_data->freq) {
/* get the appropriate clk */
clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "no clock defined\n");
ret = -ENODEV;
goto out_free_c_can;
}
priv->can.clock.freq = clk_get_rate(clk);
priv->priv = clk;
dev_err(&pdev->dev, "no clock frequency defined\n");
ret = -ENODEV;
goto out_free_c_can;
} else {
priv->can.clock.freq = c_can_pci_data->freq;
priv->priv = NULL;
}

/* Configure CAN type */
Expand All @@ -138,7 +129,7 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
break;
default:
ret = -EINVAL;
goto out_free_clock;
goto out_free_c_can;
}

/* Configure access to registers */
Expand All @@ -153,24 +144,21 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
break;
default:
ret = -EINVAL;
goto out_free_clock;
goto out_free_c_can;
}

ret = register_c_can_dev(dev);
if (ret) {
dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
KBUILD_MODNAME, ret);
goto out_free_clock;
goto out_free_c_can;
}

dev_dbg(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n",
KBUILD_MODNAME, priv->regs, dev->irq);

return 0;

out_free_clock:
if (priv->priv)
clk_put(priv->priv);
out_free_c_can:
pci_set_drvdata(pdev, NULL);
free_c_can_dev(dev);
Expand All @@ -193,9 +181,6 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev)

unregister_c_can_dev(dev);

if (priv->priv)
clk_put(priv->priv);

pci_set_drvdata(pdev, NULL);
free_c_can_dev(dev);

Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/net/ethernet/intel/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,18 +1078,18 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
netdev->priv_flags |= IFF_SUPP_NOFCS;

netdev->features |= netdev->hw_features;
netdev->hw_features |= NETIF_F_RXCSUM;
netdev->hw_features |= NETIF_F_RXALL;
netdev->hw_features |= NETIF_F_RXFCS;
netdev->hw_features |= (NETIF_F_RXCSUM |
NETIF_F_RXALL |
NETIF_F_RXFCS);

if (pci_using_dac) {
netdev->features |= NETIF_F_HIGHDMA;
netdev->vlan_features |= NETIF_F_HIGHDMA;
}

netdev->vlan_features |= NETIF_F_TSO;
netdev->vlan_features |= NETIF_F_HW_CSUM;
netdev->vlan_features |= NETIF_F_SG;
netdev->vlan_features |= (NETIF_F_TSO |
NETIF_F_HW_CSUM |
NETIF_F_SG);

netdev->priv_flags |= IFF_UNICAST_FLT;

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/intel/igb/e1000_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@

/* TX Rate Limit Registers */
#define E1000_RTTDQSEL 0x3604 /* Tx Desc Plane Queue Select - WO */
#define E1000_RTTBCNRM 0x3690 /* Tx BCN Rate-scheduler MMW */
#define E1000_RTTBCNRC 0x36B0 /* Tx BCN Rate-Scheduler Config - WO */

/* Split and Replication RX Control - RW */
Expand Down
25 changes: 19 additions & 6 deletions trunk/drivers/net/ethernet/intel/igb/igb.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,30 @@ struct igb_adapter;
#define MAX_Q_VECTORS 8

/* Transmit and receive queues */
#define IGB_MAX_RX_QUEUES ((adapter->vfs_allocated_count ? 2 : \
(hw->mac.type > e1000_82575 ? 8 : 4)))
#define IGB_MAX_RX_QUEUES_I210 4
#define IGB_MAX_RX_QUEUES 8
#define IGB_MAX_RX_QUEUES_82575 4
#define IGB_MAX_RX_QUEUES_I211 2
#define IGB_MAX_TX_QUEUES 16
#define IGB_MAX_TX_QUEUES_I210 4
#define IGB_MAX_TX_QUEUES_I211 2
#define IGB_MAX_TX_QUEUES 8
#define IGB_MAX_VF_MC_ENTRIES 30
#define IGB_MAX_VF_FUNCTIONS 8
#define IGB_MAX_VFTA_ENTRIES 128
#define IGB_82576_VF_DEV_ID 0x10CA
#define IGB_I350_VF_DEV_ID 0x1520

/* NVM version defines */
#define IGB_MAJOR_MASK 0xF000
#define IGB_MINOR_MASK 0x0FF0
#define IGB_BUILD_MASK 0x000F
#define IGB_COMB_VER_MASK 0x00FF
#define IGB_MAJOR_SHIFT 12
#define IGB_MINOR_SHIFT 4
#define IGB_COMB_VER_SHFT 8
#define IGB_NVM_VER_INVALID 0xFFFF
#define IGB_ETRACK_SHIFT 16
#define NVM_ETRACK_WORD 0x0042
#define NVM_COMB_VER_OFF 0x0083
#define NVM_COMB_VER_PTR 0x003d

struct vf_data_storage {
unsigned char vf_mac_addresses[ETH_ALEN];
u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES];
Expand Down Expand Up @@ -371,6 +382,7 @@ struct igb_adapter {
spinlock_t tmreg_lock;
struct cyclecounter cc;
struct timecounter tc;
char fw_version[32];
};

#define IGB_FLAG_HAS_MSI (1 << 0)
Expand Down Expand Up @@ -420,6 +432,7 @@ extern void igb_update_stats(struct igb_adapter *, struct rtnl_link_stats64 *);
extern bool igb_has_link(struct igb_adapter *adapter);
extern void igb_set_ethtool_ops(struct net_device *);
extern void igb_power_up_link(struct igb_adapter *);
extern void igb_set_fw_version(struct igb_adapter *);
#ifdef CONFIG_IGB_PTP
extern void igb_ptp_init(struct igb_adapter *adapter);
extern void igb_ptp_remove(struct igb_adapter *adapter);
Expand Down
52 changes: 42 additions & 10 deletions trunk/drivers/net/ethernet/intel/igb/igb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ static int igb_set_eeprom(struct net_device *netdev,
if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG)))
hw->nvm.ops.update(hw);

igb_set_fw_version(adapter);
kfree(eeprom_buff);
return ret_val;
}
Expand All @@ -718,20 +719,16 @@ static void igb_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo)
{
struct igb_adapter *adapter = netdev_priv(netdev);
u16 eeprom_data;

strlcpy(drvinfo->driver, igb_driver_name, sizeof(drvinfo->driver));
strlcpy(drvinfo->version, igb_driver_version, sizeof(drvinfo->version));

/* EEPROM image version # is reported as firmware version # for
* 82575 controllers */
adapter->hw.nvm.ops.read(&adapter->hw, 5, 1, &eeprom_data);
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
"%d.%d-%d",
(eeprom_data & 0xF000) >> 12,
(eeprom_data & 0x0FF0) >> 4,
eeprom_data & 0x000F);

/*
* EEPROM image version # is reported as firmware version # for
* 82575 controllers
*/
strlcpy(drvinfo->fw_version, adapter->fw_version,
sizeof(drvinfo->fw_version));
strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
sizeof(drvinfo->bus_info));
drvinfo->n_stats = IGB_STATS_LEN;
Expand Down Expand Up @@ -2271,6 +2268,38 @@ static void igb_ethtool_complete(struct net_device *netdev)
pm_runtime_put(&adapter->pdev->dev);
}

#ifdef CONFIG_IGB_PTP
static int igb_ethtool_get_ts_info(struct net_device *dev,
struct ethtool_ts_info *info)
{
struct igb_adapter *adapter = netdev_priv(dev);

info->so_timestamping =
SOF_TIMESTAMPING_TX_HARDWARE |
SOF_TIMESTAMPING_RX_HARDWARE |
SOF_TIMESTAMPING_RAW_HARDWARE;

if (adapter->ptp_clock)
info->phc_index = ptp_clock_index(adapter->ptp_clock);
else
info->phc_index = -1;

info->tx_types =
(1 << HWTSTAMP_TX_OFF) |
(1 << HWTSTAMP_TX_ON);

info->rx_filters =
(1 << HWTSTAMP_FILTER_NONE) |
(1 << HWTSTAMP_FILTER_ALL) |
(1 << HWTSTAMP_FILTER_SOME) |
(1 << HWTSTAMP_FILTER_PTP_V1_L4_SYNC) |
(1 << HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) |
(1 << HWTSTAMP_FILTER_PTP_V2_EVENT);

return 0;
}

#endif
static const struct ethtool_ops igb_ethtool_ops = {
.get_settings = igb_get_settings,
.set_settings = igb_set_settings,
Expand Down Expand Up @@ -2299,6 +2328,9 @@ static const struct ethtool_ops igb_ethtool_ops = {
.set_coalesce = igb_set_coalesce,
.begin = igb_ethtool_begin,
.complete = igb_ethtool_complete,
#ifdef CONFIG_IGB_PTP
.get_ts_info = igb_ethtool_get_ts_info,
#endif
};

void igb_set_ethtool_ops(struct net_device *netdev)
Expand Down
Loading

0 comments on commit b833cf4

Please sign in to comment.