aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-07-05 19:13:55 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-10 12:41:09 -0400
commit4638aef1e2d8d938e52cd49f6492e9d414b38380 (patch)
tree9bdc38cc8a22f431510a844291d18bcba578bd3a /drivers/net/netxen
parent8abd531e3f77188de2fc41e677d075cc66e61631 (diff)
netxen: deinline and sparse fix
Get rid of dubious casts to (void *) which causes a sparse warning. And move largeish function from inline to the one file that uses the code, the compiler can then decide to inline it. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r--drivers/net/netxen/netxen_nic.h103
-rw-r--r--drivers/net/netxen/netxen_nic_main.c97
2 files changed, 97 insertions, 103 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 619503742b7d..325269d8ae38 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -1097,109 +1097,6 @@ int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu);
1097int netxen_nic_set_mac(struct net_device *netdev, void *p); 1097int netxen_nic_set_mac(struct net_device *netdev, void *p);
1098struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev); 1098struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev);
1099 1099
1100static inline void netxen_nic_disable_int(struct netxen_adapter *adapter)
1101{
1102 uint32_t mask = 0x7ff;
1103 int retries = 32;
1104
1105 DPRINTK(1, INFO, "Entered ISR Disable \n");
1106
1107 switch (adapter->portnum) {
1108 case 0:
1109 writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_0));
1110 break;
1111 case 1:
1112 writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_1));
1113 break;
1114 case 2:
1115 writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_2));
1116 break;
1117 case 3:
1118 writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_3));
1119 break;
1120 }
1121
1122 if (adapter->intr_scheme != -1 &&
1123 adapter->intr_scheme != INTR_SCHEME_PERPORT) {
1124 writel(mask,
1125 (void *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
1126 }
1127
1128 /* Window = 0 or 1 */
1129 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
1130 do {
1131 writel(0xffffffff, (void *)
1132 (PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_STATUS)));
1133 mask = readl((void *)
1134 (pci_base_offset(adapter, ISR_INT_VECTOR)));
1135 if (!(mask & 0x80))
1136 break;
1137 udelay(10);
1138 } while (--retries);
1139
1140 if (!retries) {
1141 printk(KERN_NOTICE "%s: Failed to disable interrupt completely\n",
1142 netxen_nic_driver_name);
1143 }
1144 }
1145
1146 DPRINTK(1, INFO, "Done with Disable Int\n");
1147
1148 return;
1149}
1150
1151static inline void netxen_nic_enable_int(struct netxen_adapter *adapter)
1152{
1153 u32 mask;
1154
1155 DPRINTK(1, INFO, "Entered ISR Enable \n");
1156
1157 if (adapter->intr_scheme != -1 &&
1158 adapter->intr_scheme != INTR_SCHEME_PERPORT) {
1159 switch (adapter->ahw.board_type) {
1160 case NETXEN_NIC_GBE:
1161 mask = 0x77b;
1162 break;
1163 case NETXEN_NIC_XGBE:
1164 mask = 0x77f;
1165 break;
1166 default:
1167 mask = 0x7ff;
1168 break;
1169 }
1170
1171 writel(mask,
1172 (void *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
1173 }
1174 switch (adapter->portnum) {
1175 case 0:
1176 writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_0));
1177 break;
1178 case 1:
1179 writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_1));
1180 break;
1181 case 2:
1182 writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_2));
1183 break;
1184 case 3:
1185 writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_3));
1186 break;
1187 }
1188
1189 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
1190 mask = 0xbff;
1191 if (adapter->intr_scheme != -1 &&
1192 adapter->intr_scheme != INTR_SCHEME_PERPORT) {
1193 writel(0X0, NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
1194 }
1195 writel(mask,
1196 (void *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_MASK)));
1197 }
1198
1199 DPRINTK(1, INFO, "Done with enable Int\n");
1200
1201 return;
1202}
1203 1100
1204/* 1101/*
1205 * NetXen Board information 1102 * NetXen Board information
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index a66ff58366cf..56f8197b953b 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -156,6 +156,103 @@ static inline void netxen_nic_update_cmd_consumer(struct netxen_adapter *adapter
156#define ADAPTER_LIST_SIZE 12 156#define ADAPTER_LIST_SIZE 12
157int netxen_cards_found; 157int netxen_cards_found;
158 158
159static void netxen_nic_disable_int(struct netxen_adapter *adapter)
160{
161 uint32_t mask = 0x7ff;
162 int retries = 32;
163
164 DPRINTK(1, INFO, "Entered ISR Disable \n");
165
166 switch (adapter->portnum) {
167 case 0:
168 writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_0));
169 break;
170 case 1:
171 writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_1));
172 break;
173 case 2:
174 writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_2));
175 break;
176 case 3:
177 writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_3));
178 break;
179 }
180
181 if (adapter->intr_scheme != -1 &&
182 adapter->intr_scheme != INTR_SCHEME_PERPORT)
183 writel(mask,PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
184
185 /* Window = 0 or 1 */
186 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
187 do {
188 writel(0xffffffff,
189 PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_STATUS));
190 mask = readl(pci_base_offset(adapter, ISR_INT_VECTOR));
191 if (!(mask & 0x80))
192 break;
193 udelay(10);
194 } while (--retries);
195
196 if (!retries) {
197 printk(KERN_NOTICE "%s: Failed to disable interrupt completely\n",
198 netxen_nic_driver_name);
199 }
200 }
201
202 DPRINTK(1, INFO, "Done with Disable Int\n");
203}
204
205static void netxen_nic_enable_int(struct netxen_adapter *adapter)
206{
207 u32 mask;
208
209 DPRINTK(1, INFO, "Entered ISR Enable \n");
210
211 if (adapter->intr_scheme != -1 &&
212 adapter->intr_scheme != INTR_SCHEME_PERPORT) {
213 switch (adapter->ahw.board_type) {
214 case NETXEN_NIC_GBE:
215 mask = 0x77b;
216 break;
217 case NETXEN_NIC_XGBE:
218 mask = 0x77f;
219 break;
220 default:
221 mask = 0x7ff;
222 break;
223 }
224
225 writel(mask, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
226 }
227
228 switch (adapter->portnum) {
229 case 0:
230 writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_0));
231 break;
232 case 1:
233 writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_1));
234 break;
235 case 2:
236 writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_2));
237 break;
238 case 3:
239 writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_3));
240 break;
241 }
242
243 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
244 mask = 0xbff;
245 if (adapter->intr_scheme != -1 &&
246 adapter->intr_scheme != INTR_SCHEME_PERPORT) {
247 writel(0X0, NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
248 }
249 writel(mask,
250 PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_MASK));
251 }
252
253 DPRINTK(1, INFO, "Done with enable Int\n");
254}
255
159/* 256/*
160 * netxen_nic_probe() 257 * netxen_nic_probe()
161 * 258 *