Commit 8cb03f4e authored by Jonathan Cooper's avatar Jonathan Cooper Committed by David S. Miller
Browse files

sfc: Encapsulate access to netdev_priv()



Once we separate struct efx_nic memory from net_device memory the
existing usage will have to change.
Apart from the new function efx_netdev_priv() accesses have been
changed using:
  sed -i 's/netdev_priv/efx_netdev_priv/'

Signed-off-by: default avatarJonathan Cooper <jonathan.s.cooper@amd.com>
Co-developed-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3fd0a86
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3874,7 +3874,7 @@ static int efx_ef10_udp_tnl_set_port(struct net_device *dev,
				     unsigned int table, unsigned int entry,
				     struct udp_tunnel_info *ti)
{
	struct efx_nic *efx = netdev_priv(dev);
	struct efx_nic *efx = efx_netdev_priv(dev);
	struct efx_ef10_nic_data *nic_data;
	int efx_tunnel_type, rc;

@@ -3934,7 +3934,7 @@ static int efx_ef10_udp_tnl_unset_port(struct net_device *dev,
				       unsigned int table, unsigned int entry,
				       struct udp_tunnel_info *ti)
{
	struct efx_nic *efx = netdev_priv(dev);
	struct efx_nic *efx = efx_netdev_priv(dev);
	struct efx_ef10_nic_data *nic_data;
	int rc;

+1 −1
Original line number Diff line number Diff line
@@ -464,7 +464,7 @@ static int ef100_pci_probe(struct pci_dev *pci_dev,
	net_dev = alloc_etherdev_mq(sizeof(*efx), EFX_MAX_CORE_TX_QUEUES);
	if (!net_dev)
		return -ENOMEM;
	efx = netdev_priv(net_dev);
	efx = efx_netdev_priv(net_dev);
	efx->type = (const struct efx_nic_type *)entry->driver_data;

	pci_set_drvdata(pci_dev, efx);
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ ef100_ethtool_get_ringparam(struct net_device *net_dev,
			    struct kernel_ethtool_ringparam *kernel_ring,
			    struct netlink_ext_ack *extack)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);

	ring->rx_max_pending = EFX_EF100_MAX_DMAQ_SIZE;
	ring->tx_max_pending = EFX_EF100_MAX_DMAQ_SIZE;
+4 −4
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static int ef100_remap_bar(struct efx_nic *efx, int max_vis)
 */
static int ef100_net_stop(struct net_device *net_dev)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);

	netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n",
		  raw_smp_processor_id());
@@ -104,7 +104,7 @@ static int ef100_net_stop(struct net_device *net_dev)
/* Context: process, rtnl_lock() held. */
static int ef100_net_open(struct net_device *net_dev)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);
	unsigned int allocated_vis;
	int rc;

@@ -193,7 +193,7 @@ static int ef100_net_open(struct net_device *net_dev)
static netdev_tx_t ef100_hard_start_xmit(struct sk_buff *skb,
					 struct net_device *net_dev)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);
	struct efx_tx_queue *tx_queue;
	struct efx_channel *channel;
	int rc;
@@ -243,7 +243,7 @@ int ef100_netdev_event(struct notifier_block *this,
	struct efx_nic *efx = container_of(this, struct efx_nic, netdev_notifier);
	struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);

	if (netdev_priv(net_dev) == efx && event == NETDEV_CHANGENAME)
	if (efx_netdev_priv(net_dev) == efx && event == NETDEV_CHANGENAME)
		ef100_update_name(efx);

	return NOTIFY_DONE;
+10 −10
Original line number Diff line number Diff line
@@ -492,7 +492,7 @@ void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs,
 */
static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);
	struct mii_ioctl_data *data = if_mii(ifr);

	if (cmd == SIOCSHWTSTAMP)
@@ -517,7 +517,7 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
/* Context: process, rtnl_lock() held. */
int efx_net_open(struct net_device *net_dev)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);
	int rc;

	netif_dbg(efx, ifup, efx->net_dev, "opening device on CPU %d\n",
@@ -551,7 +551,7 @@ int efx_net_open(struct net_device *net_dev)
 */
int efx_net_stop(struct net_device *net_dev)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);

	netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n",
		  raw_smp_processor_id());
@@ -564,7 +564,7 @@ int efx_net_stop(struct net_device *net_dev)

static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);

	if (efx->type->vlan_rx_add_vid)
		return efx->type->vlan_rx_add_vid(efx, proto, vid);
@@ -574,7 +574,7 @@ static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid

static int efx_vlan_rx_kill_vid(struct net_device *net_dev, __be16 proto, u16 vid)
{
	struct efx_nic *efx = netdev_priv(net_dev);
	struct efx_nic *efx = efx_netdev_priv(net_dev);

	if (efx->type->vlan_rx_kill_vid)
		return efx->type->vlan_rx_kill_vid(efx, proto, vid);
@@ -643,7 +643,7 @@ static int efx_xdp_setup_prog(struct efx_nic *efx, struct bpf_prog *prog)
/* Context: process, rtnl_lock() held. */
static int efx_xdp(struct net_device *dev, struct netdev_bpf *xdp)
{
	struct efx_nic *efx = netdev_priv(dev);
	struct efx_nic *efx = efx_netdev_priv(dev);

	switch (xdp->command) {
	case XDP_SETUP_PROG:
@@ -656,7 +656,7 @@ static int efx_xdp(struct net_device *dev, struct netdev_bpf *xdp)
static int efx_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **xdpfs,
			u32 flags)
{
	struct efx_nic *efx = netdev_priv(dev);
	struct efx_nic *efx = efx_netdev_priv(dev);

	if (!netif_running(dev))
		return -EINVAL;
@@ -678,7 +678,7 @@ static int efx_netdev_event(struct notifier_block *this,

	if ((net_dev->netdev_ops == &efx_netdev_ops) &&
	    event == NETDEV_CHANGENAME)
		efx_update_name(netdev_priv(net_dev));
		efx_update_name(efx_netdev_priv(net_dev));

	return NOTIFY_DONE;
}
@@ -774,7 +774,7 @@ static void efx_unregister_netdev(struct efx_nic *efx)
	if (!efx->net_dev)
		return;

	if (WARN_ON(netdev_priv(efx->net_dev) != efx))
	if (WARN_ON(efx_netdev_priv(efx->net_dev) != efx))
		return;

	if (efx_dev_registered(efx)) {
@@ -1051,7 +1051,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
				     EFX_MAX_RX_QUEUES);
	if (!net_dev)
		return -ENOMEM;
	efx = netdev_priv(net_dev);
	efx = efx_netdev_priv(net_dev);
	efx->type = (const struct efx_nic_type *) entry->driver_data;
	efx->fixed_features |= NETIF_F_HIGHDMA;

Loading