Skip to content

Commit

Permalink
igb: change pba size determination from if to switch statement
Browse files Browse the repository at this point in the history
As additional hardware is added to the igb driver it is easier to support
the expansion via switch statements instead of using nested ifs.  For
this reason I am changing this to a switch statement.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Feb 7, 2009
1 parent a8564f0 commit fa4dfae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,11 +888,14 @@ void igb_reset(struct igb_adapter *adapter)
/* Repartition Pba for greater than 9k mtu
* To take effect CTRL.RST is required.
*/
if (mac->type != e1000_82576) {
pba = E1000_PBA_34K;
}
else {
switch (mac->type) {
case e1000_82576:
pba = E1000_PBA_64K;
break;
case e1000_82575:
default:
pba = E1000_PBA_34K;
break;
}

if ((adapter->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN) &&
Expand Down

0 comments on commit fa4dfae

Please sign in to comment.