aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/igb_main.c77
1 files changed, 37 insertions, 40 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index be480292aba1..adb09d32625d 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -127,14 +127,48 @@ static void igb_restore_vlan(struct igb_adapter *);
127static void igb_ping_all_vfs(struct igb_adapter *); 127static void igb_ping_all_vfs(struct igb_adapter *);
128static void igb_msg_task(struct igb_adapter *); 128static void igb_msg_task(struct igb_adapter *);
129static int igb_rcv_msg_from_vf(struct igb_adapter *, u32); 129static int igb_rcv_msg_from_vf(struct igb_adapter *, u32);
130static inline void igb_set_rah_pool(struct e1000_hw *, int , int);
131static void igb_set_mc_list_pools(struct igb_adapter *, int, u16); 130static void igb_set_mc_list_pools(struct igb_adapter *, int, u16);
132static void igb_vmm_control(struct igb_adapter *); 131static void igb_vmm_control(struct igb_adapter *);
133static inline void igb_set_vmolr(struct e1000_hw *, int);
134static inline int igb_set_vf_rlpml(struct igb_adapter *, int, int);
135static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *); 132static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *);
136static void igb_restore_vf_multicasts(struct igb_adapter *adapter); 133static void igb_restore_vf_multicasts(struct igb_adapter *adapter);
137 134
135static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
136{
137 u32 reg_data;
138
139 reg_data = rd32(E1000_VMOLR(vfn));
140 reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */
141 E1000_VMOLR_ROPE | /* Accept packets matched in UTA */
142 E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */
143 E1000_VMOLR_AUPE | /* Accept untagged packets */
144 E1000_VMOLR_STRVLAN; /* Strip vlan tags */
145 wr32(E1000_VMOLR(vfn), reg_data);
146}
147
148static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
149 int vfn)
150{
151 struct e1000_hw *hw = &adapter->hw;
152 u32 vmolr;
153
154 vmolr = rd32(E1000_VMOLR(vfn));
155 vmolr &= ~E1000_VMOLR_RLPML_MASK;
156 vmolr |= size | E1000_VMOLR_LPE;
157 wr32(E1000_VMOLR(vfn), vmolr);
158
159 return 0;
160}
161
162static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry)
163{
164 u32 reg_data;
165
166 reg_data = rd32(E1000_RAH(entry));
167 reg_data &= ~E1000_RAH_POOL_MASK;
168 reg_data |= E1000_RAH_POOL_1 << pool;;
169 wr32(E1000_RAH(entry), reg_data);
170}
171
138#ifdef CONFIG_PM 172#ifdef CONFIG_PM
139static int igb_suspend(struct pci_dev *, pm_message_t); 173static int igb_suspend(struct pci_dev *, pm_message_t);
140static int igb_resume(struct pci_dev *); 174static int igb_resume(struct pci_dev *);
@@ -5418,43 +5452,6 @@ static void igb_io_resume(struct pci_dev *pdev)
5418 igb_get_hw_control(adapter); 5452 igb_get_hw_control(adapter);
5419} 5453}
5420 5454
5421static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
5422{
5423 u32 reg_data;
5424
5425 reg_data = rd32(E1000_VMOLR(vfn));
5426 reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */
5427 E1000_VMOLR_ROPE | /* Accept packets matched in UTA */
5428 E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */
5429 E1000_VMOLR_AUPE | /* Accept untagged packets */
5430 E1000_VMOLR_STRVLAN; /* Strip vlan tags */
5431 wr32(E1000_VMOLR(vfn), reg_data);
5432}
5433
5434static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
5435 int vfn)
5436{
5437 struct e1000_hw *hw = &adapter->hw;
5438 u32 vmolr;
5439
5440 vmolr = rd32(E1000_VMOLR(vfn));
5441 vmolr &= ~E1000_VMOLR_RLPML_MASK;
5442 vmolr |= size | E1000_VMOLR_LPE;
5443 wr32(E1000_VMOLR(vfn), vmolr);
5444
5445 return 0;
5446}
5447
5448static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry)
5449{
5450 u32 reg_data;
5451
5452 reg_data = rd32(E1000_RAH(entry));
5453 reg_data &= ~E1000_RAH_POOL_MASK;
5454 reg_data |= E1000_RAH_POOL_1 << pool;;
5455 wr32(E1000_RAH(entry), reg_data);
5456}
5457
5458static void igb_set_mc_list_pools(struct igb_adapter *adapter, 5455static void igb_set_mc_list_pools(struct igb_adapter *adapter,
5459 int entry_count, u16 total_rar_filters) 5456 int entry_count, u16 total_rar_filters)
5460{ 5457{