Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0340501b authored by Jeff Kirsher's avatar Jeff Kirsher
Browse files

igbvf: Fix code comments and whitespace



Fix the code comments to align with the drivers/net/ commenting style.
Also fix other checkpatch errors such as using tabs where possible and
properly wrap lines to conform to the 80 char limit (unless it is
a string).

Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
parent 79849ebc
Loading
Loading
Loading
Loading
+63 −65
Original line number Diff line number Diff line
@@ -13,8 +13,7 @@
  more details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  this program; if not, see <http://www.gnu.org/licenses/>.

  The full GNU General Public License is included in this distribution in
  the file called "COPYING".
@@ -55,7 +54,6 @@
#define E1000_RXDEXT_STATERR_IPE	0x40000000
#define E1000_RXDEXT_STATERR_RXE	0x80000000


/* Same mask, but for extended and packet split descriptors */
#define E1000_RXDEXT_ERR_FRAME_ERR_MASK ( \
	E1000_RXDEXT_STATERR_CE  | \
@@ -84,8 +82,8 @@
/* Transmit Descriptor bit definitions */
#define E1000_TXD_POPTS_IXSM	0x01       /* Insert IP checksum */
#define E1000_TXD_POPTS_TXSM	0x02       /* Insert TCP/UDP checksum */
#define E1000_TXD_CMD_DEXT   0x20000000 /* Descriptor extension (0 = legacy) */
#define E1000_TXD_STAT_DD    0x00000001 /* Descriptor Done */
#define E1000_TXD_CMD_DEXT	0x20000000 /* Desc extension (0 = legacy) */
#define E1000_TXD_STAT_DD	0x00000001 /* Desc Done */

#define MAX_JUMBO_FRAME_SIZE	0x3F00

@@ -111,8 +109,8 @@
#define E1000_SRRCTL_BSIZEHDR_MASK	0x00003F00

/* Additional Descriptor Control definitions */
#define E1000_TXDCTL_QUEUE_ENABLE  0x02000000 /* Enable specific Tx Queue */
#define E1000_RXDCTL_QUEUE_ENABLE  0x02000000 /* Enable specific Rx Queue */
#define E1000_TXDCTL_QUEUE_ENABLE	0x02000000 /* Enable specific Tx Que */
#define E1000_RXDCTL_QUEUE_ENABLE	0x02000000 /* Enable specific Rx Que */

/* Direct Cache Access (DCA) definitions */
#define E1000_DCA_TXCTRL_TX_WB_RO_EN	(1 << 11) /* Tx Desc writeback RO bit */
+35 −38
Original line number Diff line number Diff line
@@ -13,8 +13,7 @@
  more details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  this program; if not, see <http://www.gnu.org/licenses/>.

  The full GNU General Public License is included in this distribution in
  the file called "COPYING".
@@ -36,7 +35,6 @@
#include "igbvf.h"
#include <linux/if_vlan.h>


struct igbvf_stats {
	char stat_string[ETH_GSTRING_LEN];
	int sizeof_stat;
@@ -130,12 +128,14 @@ static int igbvf_set_pauseparam(struct net_device *netdev,
static u32 igbvf_get_msglevel(struct net_device *netdev)
{
	struct igbvf_adapter *adapter = netdev_priv(netdev);

	return adapter->msg_enable;
}

static void igbvf_set_msglevel(struct net_device *netdev, u32 data)
{
	struct igbvf_adapter *adapter = netdev_priv(netdev);

	adapter->msg_enable = data;
}

@@ -255,10 +255,9 @@ static int igbvf_set_ringparam(struct net_device *netdev,

	igbvf_down(adapter);

	/*
	 * We can't just free everything and then setup again,
	/* We can't just free everything and then setup again,
	 * because the ISRs in MSI-X mode get passed pointers
	 * to the tx and rx ring structs.
	 * to the Tx and Rx ring structs.
	 */
	if (new_tx_count != adapter->tx_ring->count) {
		memcpy(temp_ring, adapter->tx_ring, sizeof(struct igbvf_ring));
@@ -313,8 +312,7 @@ static void igbvf_diag_test(struct net_device *netdev,

	set_bit(__IGBVF_TESTING, &adapter->state);

	/*
	 * Link test performed before hardware reset so autoneg doesn't
	/* Link test performed before hardware reset so autoneg doesn't
	 * interfere with test result
	 */
	if (igbvf_link_test(adapter, &data[0]))
@@ -366,8 +364,7 @@ static int igbvf_set_coalesce(struct net_device *netdev,
		adapter->current_itr = IGBVF_START_ITR;
		adapter->requested_itr = ec->rx_coalesce_usecs;
	} else if (ec->rx_coalesce_usecs == 0) {
		/*
		 * The user's desire is to turn off interrupt throttling
		/* The user's desire is to turn off interrupt throttling
		 * altogether, but due to HW limitations, we can't do that.
		 * Instead we set a very small value in EITR, which would
		 * allow ~967k interrupts per second, but allow the adapter's
@@ -376,8 +373,9 @@ static int igbvf_set_coalesce(struct net_device *netdev,
		adapter->current_itr = 4;
		adapter->requested_itr = 1000000000 /
					(adapter->current_itr * 256);
	} else
	} else {
		return -EINVAL;
	}

	writel(adapter->current_itr,
	       hw->hw_addr + adapter->rx_ring->itr_register);
@@ -388,12 +386,12 @@ static int igbvf_set_coalesce(struct net_device *netdev,
static int igbvf_nway_reset(struct net_device *netdev)
{
	struct igbvf_adapter *adapter = netdev_priv(netdev);

	if (netif_running(netdev))
		igbvf_reinit_locked(adapter);
	return 0;
}


static void igbvf_get_ethtool_stats(struct net_device *netdev,
				    struct ethtool_stats *stats,
				    u64 *data)
@@ -411,7 +409,6 @@ static void igbvf_get_ethtool_stats(struct net_device *netdev,
			    sizeof(u64)) ? (*(u64 *)p - *(u64 *)b) :
			    (*(u32 *)p - *(u32 *)b));
	}

}

static int igbvf_get_sset_count(struct net_device *dev, int stringset)
+48 −55
Original line number Diff line number Diff line
@@ -13,8 +13,7 @@
  more details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  this program; if not, see <http://www.gnu.org/licenses/>.

  The full GNU General Public License is included in this distribution in
  the file called "COPYING".
@@ -55,7 +54,6 @@ enum latency_range {
	latency_invalid = 255
};


/* Interrupt modes, as used by the IntMode parameter */
#define IGBVF_INT_MODE_LEGACY	0
#define IGBVF_INT_MODE_MSI	1
@@ -116,8 +114,7 @@ struct igbvf_queue_stats {
	u64 bytes;
};

/*
 * wrappers around a pointer to a socket buffer,
/* wrappers around a pointer to a socket buffer,
 * so a DMA handle can be stored along with the buffer
 */
struct igbvf_buffer {
@@ -202,9 +199,7 @@ struct igbvf_adapter {
	u32 requested_itr; /* ints/sec or adaptive */
	u32 current_itr; /* Actual ITR register value, not ints/sec */

	/*
	 * Tx
	 */
	/* Tx */
	struct igbvf_ring *tx_ring /* One per active queue */
	____cacheline_aligned_in_smp;

@@ -226,9 +221,7 @@ struct igbvf_adapter {
	u32 tx_fifo_size;
	u32 tx_dma_failed;

	/*
	 * Rx
	 */
	/* Rx */
	struct igbvf_ring *rx_ring;

	u32 rx_int_delay;
+10 −11
Original line number Diff line number Diff line
@@ -13,8 +13,7 @@
  more details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  this program; if not, see <http://www.gnu.org/licenses/>.

  The full GNU General Public License is included in this distribution in
  the file called "COPYING".
@@ -54,10 +53,10 @@ out:
}

/**
 *  e1000_poll_for_ack - Wait for message acknowledgement
 *  e1000_poll_for_ack - Wait for message acknowledgment
 *  @hw: pointer to the HW structure
 *
 *  returns SUCCESS if it successfully received a message acknowledgement
 *  returns SUCCESS if it successfully received a message acknowledgment
 **/
static s32 e1000_poll_for_ack(struct e1000_hw *hw)
{
@@ -239,7 +238,7 @@ static s32 e1000_obtain_mbx_lock_vf(struct e1000_hw *hw)
	/* Take ownership of the buffer */
	ew32(V2PMAILBOX(0), E1000_V2PMAILBOX_VFU);

	/* reserve mailbox for vf use */
	/* reserve mailbox for VF use */
	if (e1000_read_v2p_mailbox(hw) & E1000_V2PMAILBOX_VFU)
		ret_val = E1000_SUCCESS;

@@ -283,7 +282,7 @@ out_no_write:
}

/**
 *  e1000_read_mbx_vf - Reads a message from the inbox intended for vf
 *  e1000_read_mbx_vf - Reads a message from the inbox intended for VF
 *  @hw: pointer to the HW structure
 *  @msg: The message buffer
 *  @size: Length of buffer
@@ -315,17 +314,18 @@ out_no_read:
}

/**
 *  e1000_init_mbx_params_vf - set initial values for vf mailbox
 *  e1000_init_mbx_params_vf - set initial values for VF mailbox
 *  @hw: pointer to the HW structure
 *
 *  Initializes the hw->mbx struct to correct values for vf mailbox
 *  Initializes the hw->mbx struct to correct values for VF mailbox
 */
s32 e1000_init_mbx_params_vf(struct e1000_hw *hw)
{
	struct e1000_mbx_info *mbx = &hw->mbx;

	/* start mailbox as timed out and let the reset_hw call set the timeout
	 * value to being communications */
	 * value to being communications
	 */
	mbx->timeout = 0;
	mbx->usec_delay = E1000_VF_MBX_INIT_DELAY;

@@ -347,4 +347,3 @@ s32 e1000_init_mbx_params_vf(struct e1000_hw *hw)

	return E1000_SUCCESS;
}
+26 −27
Original line number Diff line number Diff line
@@ -13,8 +13,7 @@
  more details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  this program; if not, see <http://www.gnu.org/licenses/>.

  The full GNU General Public License is included in this distribution in
  the file called "COPYING".
@@ -46,15 +45,15 @@
 * PF.  The reverse is true if it is E1000_PF_*.
 * Message ACK's are the value or'd with 0xF0000000
 */
#define E1000_VT_MSGTYPE_ACK      0x80000000  /* Messages below or'd with
                                               * this are the ACK */
#define E1000_VT_MSGTYPE_NACK     0x40000000  /* Messages below or'd with
                                               * this are the NACK */
#define E1000_VT_MSGTYPE_CTS      0x20000000  /* Indicates that VF is still
                                                 clear to send requests */
/* Messages below or'd with this are the ACK */
#define E1000_VT_MSGTYPE_ACK	0x80000000
/* Messages below or'd with this are the NACK */
#define E1000_VT_MSGTYPE_NACK	0x40000000
/* Indicates that VF is still clear to send requests */
#define E1000_VT_MSGTYPE_CTS	0x20000000

/* We have a total wait time of 1s for vf mailbox posted messages */
#define E1000_VF_MBX_INIT_TIMEOUT 2000 /* retry count for mailbox timeout */
#define E1000_VF_MBX_INIT_TIMEOUT	2000 /* retry count for mbx timeout */
#define E1000_VF_MBX_INIT_DELAY		500  /* usec delay between retries */

#define E1000_VT_MSGINFO_SHIFT	16
Loading