forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/net/ethernet/intel/igb/e1000_mac.c
....@@ -12,7 +12,7 @@
1212 #include "igb.h"
1313
1414 static s32 igb_set_default_fc(struct e1000_hw *hw);
15
-static s32 igb_set_fc_watermarks(struct e1000_hw *hw);
15
+static void igb_set_fc_watermarks(struct e1000_hw *hw);
1616
1717 /**
1818 * igb_get_bus_info_pcie - Get PCIe bus information
....@@ -166,6 +166,7 @@
166166 * @vlan: VLAN id to add or remove
167167 * @vind: VMDq output index that maps queue to VLAN id
168168 * @vlan_on: if true add filter, if false remove
169
+ * @vlvf_bypass: skip VLVF if no match is found
169170 *
170171 * Sets or clears a bit in the VLAN filter table array based on VLAN id
171172 * and if we are adding or removing the filter
....@@ -425,7 +426,7 @@
425426 static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
426427 {
427428 u32 hash_value, hash_mask;
428
- u8 bit_shift = 0;
429
+ u8 bit_shift = 1;
429430
430431 /* Register count multiplied by bits per register */
431432 hash_mask = (hw->mac.mta_reg_count * 32) - 1;
....@@ -433,7 +434,7 @@
433434 /* For a mc_filter_type of 0, bit_shift is the number of left-shifts
434435 * where 0xFF would still fall within the hash mask.
435436 */
436
- while (hash_mask >> bit_shift != 0xFF)
437
+ while (hash_mask >> bit_shift != 0xFF && bit_shift < 4)
437438 bit_shift++;
438439
439440 /* The portion of the address that is used for the hash table
....@@ -687,7 +688,7 @@
687688
688689 wr32(E1000_FCTTV, hw->fc.pause_time);
689690
690
- ret_val = igb_set_fc_watermarks(hw);
691
+ igb_set_fc_watermarks(hw);
691692
692693 out:
693694
....@@ -723,9 +724,8 @@
723724 * flow control XON frame transmission is enabled, then set XON frame
724725 * tansmission as well.
725726 **/
726
-static s32 igb_set_fc_watermarks(struct e1000_hw *hw)
727
+static void igb_set_fc_watermarks(struct e1000_hw *hw)
727728 {
728
- s32 ret_val = 0;
729729 u32 fcrtl = 0, fcrth = 0;
730730
731731 /* Set the flow control receive threshold registers. Normally,
....@@ -747,8 +747,6 @@
747747 }
748748 wr32(E1000_FCRTL, fcrtl);
749749 wr32(E1000_FCRTH, fcrth);
750
-
751
- return ret_val;
752750 }
753751
754752 /**