iPXE
igbvf_main.c
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  Intel(R) 82576 Virtual Function Linux driver
4  Copyright(c) 2009 Intel Corporation.
5 
6  Copyright(c) 2010 Eric Keller <ekeller@princeton.edu>
7  Copyright(c) 2010 Red Hat Inc.
8  Alex Williamson <alex.williamson@redhat.com>
9 
10  This program is free software; you can redistribute it and/or modify it
11  under the terms and conditions of the GNU General Public License,
12  version 2, as published by the Free Software Foundation.
13 
14  This program is distributed in the hope it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17  more details.
18 
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc.,
21  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
22 
23  The full GNU General Public License is included in this distribution in
24  the file called "COPYING".
25 
26  Contact Information:
27  e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
28  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
29 
30 *******************************************************************************/
31 
32 FILE_LICENCE ( GPL2_ONLY );
33 
34 #include "igbvf.h"
35 
36 /**
37  * igbvf_setup_tx_resources - allocate Tx resources (Descriptors)
38  *
39  * @v adapter e1000 private structure
40  *
41  * @ret rc Returns 0 on success, negative on failure
42  **/
43 int igbvf_setup_tx_resources ( struct igbvf_adapter *adapter )
44 {
45  DBG ( "igbvf_setup_tx_resources\n" );
46 
47  /* Allocate transmit descriptor ring memory.
48  It must not cross a 64K boundary because of hardware errata #23
49  so we use malloc_phys() requesting a 128 byte block that is
50  128 byte aligned. This should guarantee that the memory
51  allocated will not cross a 64K boundary, because 128 is an
52  even multiple of 65536 ( 65536 / 128 == 512 ), so all possible
53  allocations of 128 bytes on a 128 byte boundary will not
54  cross 64K bytes.
55  */
56 
57  adapter->tx_base =
58  malloc_phys ( adapter->tx_ring_size, adapter->tx_ring_size );
59 
60  if ( ! adapter->tx_base ) {
61  return -ENOMEM;
62  }
63 
64  memset ( adapter->tx_base, 0, adapter->tx_ring_size );
65 
66  DBG ( "adapter->tx_base = %#08lx\n", virt_to_bus ( adapter->tx_base ) );
67 
68  return 0;
69 }
70 
71 /**
72  * igbvf_free_tx_resources - Free Tx Resources per Queue
73  * @adapter: board private structure
74  *
75  * Free all transmit software resources
76  **/
77 void igbvf_free_tx_resources ( struct igbvf_adapter *adapter )
78 {
79  DBG ( "igbvf_free_tx_resources\n" );
80 
81  free_phys ( adapter->tx_base, adapter->tx_ring_size );
82 }
83 
84 /**
85  * igbvf_free_rx_resources - Free Rx Resources
86  * @adapter: board private structure
87  *
88  * Free all receive software resources
89  **/
90 void igbvf_free_rx_resources ( struct igbvf_adapter *adapter )
91 {
92  int i;
93 
94  DBG ( "igbvf_free_rx_resources\n" );
95 
96  free_phys ( adapter->rx_base, adapter->rx_ring_size );
97 
98  for ( i = 0; i < NUM_RX_DESC; i++ ) {
99  free_iob ( adapter->rx_iobuf[i] );
100  }
101 }
102 
103 /**
104  * igbvf_refill_rx_ring - allocate Rx io_buffers
105  *
106  * @v adapter e1000 private structure
107  *
108  * @ret rc Returns 0 on success, negative on failure
109  **/
110 static int igbvf_refill_rx_ring ( struct igbvf_adapter *adapter )
111 {
112  int i, rx_curr;
113  int rc = 0;
114  union e1000_adv_rx_desc *rx_curr_desc;
115  struct e1000_hw *hw = &adapter->hw;
116  struct io_buffer *iob;
117 
118  DBGP ("igbvf_refill_rx_ring\n");
119 
120  for ( i = 0; i < NUM_RX_DESC; i++ ) {
121  rx_curr = ( ( adapter->rx_curr + i ) % NUM_RX_DESC );
122  rx_curr_desc = adapter->rx_base + rx_curr;
123 
124  if ( rx_curr_desc->wb.upper.status_error & E1000_RXD_STAT_DD )
125  continue;
126 
127  if ( adapter->rx_iobuf[rx_curr] != NULL )
128  continue;
129 
130  DBG2 ( "Refilling rx desc %d\n", rx_curr );
131 
133  adapter->rx_iobuf[rx_curr] = iob;
134 
135  rx_curr_desc->wb.upper.status_error = 0;
136 
137  if ( ! iob ) {
138  DBG ( "alloc_iob failed\n" );
139  rc = -ENOMEM;
140  break;
141  } else {
142  rx_curr_desc->read.pkt_addr = virt_to_bus ( iob->data );
143  rx_curr_desc->read.hdr_addr = 0;
144  ew32 ( RDT(0), rx_curr );
145  }
146  }
147  return rc;
148 }
149 
150 /**
151  * igbvf_irq_disable - Mask off interrupt generation on the NIC
152  * @adapter: board private structure
153  **/
154 static void igbvf_irq_disable ( struct igbvf_adapter *adapter )
155 {
156  struct e1000_hw *hw = &adapter->hw;
157 
158  ew32 ( EIMC, ~0 );
159 }
160 
161 /**
162  * igbvf_irq_enable - Enable default interrupt generation settings
163  * @adapter: board private structure
164  **/
165 static void igbvf_irq_enable ( struct igbvf_adapter *adapter )
166 {
167  struct e1000_hw *hw = &adapter->hw;
168 
169  ew32 ( EIAC, IMS_ENABLE_MASK );
170  ew32 ( EIAM, IMS_ENABLE_MASK );
171  ew32 ( EIMS, IMS_ENABLE_MASK );
172 }
173 
174 /**
175  * igbvf_irq - enable or Disable interrupts
176  *
177  * @v adapter e1000 adapter
178  * @v action requested interrupt action
179  **/
180 static void igbvf_irq ( struct net_device *netdev, int enable )
181 {
182  struct igbvf_adapter *adapter = netdev->priv;
183 
184  DBG ( "igbvf_irq\n" );
185 
186  if ( enable ) {
187  igbvf_irq_enable ( adapter );
188  } else {
189  igbvf_irq_disable ( adapter );
190  }
191 }
192 
193 /**
194  * igbvf_process_tx_packets - process transmitted packets
195  *
196  * @v netdev network interface device structure
197  **/
199 {
200  struct igbvf_adapter *adapter = netdev->priv;
201  uint32_t i;
202  uint32_t tx_status;
203  union e1000_adv_tx_desc *tx_curr_desc;
204 
205  /* Check status of transmitted packets
206  */
207  DBGP ( "process_tx_packets: tx_head = %d, tx_tail = %d\n", adapter->tx_head,
208  adapter->tx_tail );
209 
210  while ( ( i = adapter->tx_head ) != adapter->tx_tail ) {
211 
212  tx_curr_desc = ( void * ) ( adapter->tx_base ) +
213  ( i * sizeof ( *adapter->tx_base ) );
214 
215  tx_status = tx_curr_desc->wb.status;
216  DBG ( " tx_curr_desc = %#08lx\n", virt_to_bus ( tx_curr_desc ) );
217  DBG ( " tx_status = %#08x\n", tx_status );
218 
219  /* if the packet at tx_head is not owned by hardware it is for us */
220  if ( ! ( tx_status & E1000_TXD_STAT_DD ) )
221  break;
222 
223  DBG ( "Sent packet. tx_head: %d tx_tail: %d tx_status: %#08x\n",
224  adapter->tx_head, adapter->tx_tail, tx_status );
225 
226  netdev_tx_complete ( netdev, adapter->tx_iobuf[i] );
227  DBG ( "Success transmitting packet, tx_status: %#08x\n",
228  tx_status );
229 
230  /* Decrement count of used descriptors, clear this descriptor
231  */
232  adapter->tx_fill_ctr--;
233  memset ( tx_curr_desc, 0, sizeof ( *tx_curr_desc ) );
234 
235  adapter->tx_head = ( adapter->tx_head + 1 ) % NUM_TX_DESC;
236  }
237 }
238 
239 /**
240  * igbvf_process_rx_packets - process received packets
241  *
242  * @v netdev network interface device structure
243  **/
245 {
246  struct igbvf_adapter *adapter = netdev->priv;
247  struct e1000_hw *hw = &adapter->hw;
248  uint32_t i;
249  uint32_t rx_status;
250  uint32_t rx_len;
252  union e1000_adv_rx_desc *rx_curr_desc;
253 
254  DBGP ( "igbvf_process_rx_packets\n" );
255 
256  /* Process received packets
257  */
258  while ( 1 ) {
259  i = adapter->rx_curr;
260 
261  rx_curr_desc = ( void * ) ( adapter->rx_base ) +
262  ( i * sizeof ( *adapter->rx_base ) );
263  rx_status = rx_curr_desc->wb.upper.status_error;
264 
265  DBG2 ( "Before DD Check RX_status: %#08x, rx_curr: %d\n",
266  rx_status, i );
267 
268  if ( ! ( rx_status & E1000_RXD_STAT_DD ) )
269  break;
270 
271  if ( adapter->rx_iobuf[i] == NULL )
272  break;
273 
274  DBG ( "E1000_RCTL = %#08x\n", er32 (RCTL) );
275 
276  rx_len = rx_curr_desc->wb.upper.length;
277 
278  DBG ( "Received packet, rx_curr: %d rx_status: %#08x rx_len: %d\n",
279  i, rx_status, rx_len );
280 
281  rx_err = rx_status;
282 
283  iob_put ( adapter->rx_iobuf[i], rx_len );
284 
286 
287  netdev_rx_err ( netdev, adapter->rx_iobuf[i], -EINVAL );
288  DBG ( "igbvf_process_rx_packets: Corrupted packet received!"
289  " rx_err: %#08x\n", rx_err );
290  } else {
291  /* Add this packet to the receive queue. */
292  netdev_rx ( netdev, adapter->rx_iobuf[i] );
293  }
294  adapter->rx_iobuf[i] = NULL;
295 
296  memset ( rx_curr_desc, 0, sizeof ( *rx_curr_desc ) );
297 
298  adapter->rx_curr = ( adapter->rx_curr + 1 ) % NUM_RX_DESC;
299  }
300 }
301 
302 /**
303  * igbvf_poll - Poll for received packets
304  *
305  * @v netdev Network device
306  */
307 static void igbvf_poll ( struct net_device *netdev )
308 {
309  struct igbvf_adapter *adapter = netdev->priv;
310  uint32_t rx_status;
311  union e1000_adv_rx_desc *rx_curr_desc;
312 
313  DBGP ( "igbvf_poll\n" );
314 
315  rx_curr_desc = ( void * ) ( adapter->rx_base ) +
316  ( adapter->rx_curr * sizeof ( *adapter->rx_base ) );
317  rx_status = rx_curr_desc->wb.upper.status_error;
318 
319  if ( ! ( rx_status & E1000_RXD_STAT_DD ) )
320  return;
321 
323 
325 
326  igbvf_refill_rx_ring ( adapter );
327 }
328 
329 /**
330  * igbvf_config_collision_dist_generic - Configure collision distance
331  * @hw: pointer to the HW structure
332  *
333  * Configures the collision distance to the default value and is used
334  * during link setup. Currently no func pointer exists and all
335  * implementations are handled in the generic version of this function.
336  **/
338 {
339  u32 tctl;
340 
341  DBG ("igbvf_config_collision_dist");
342 
343  tctl = er32 (TCTL);
344 
345  tctl &= ~E1000_TCTL_COLD;
347 
348  ew32 (TCTL, tctl);
349  e1e_flush();
350 }
351 
352 /**
353  * igbvf_configure_tx - Configure Transmit Unit after Reset
354  * @adapter: board private structure
355  *
356  * Configure the Tx unit of the MAC after a reset.
357  **/
358 static void igbvf_configure_tx ( struct igbvf_adapter *adapter )
359 {
360  struct e1000_hw *hw = &adapter->hw;
361  u32 tctl, txdctl;
362 
363  DBG ( "igbvf_configure_tx\n" );
364 
365  /* disable transmits while setting up the descriptors */
366  tctl = er32 ( TCTL );
367  ew32 ( TCTL, tctl & ~E1000_TCTL_EN );
368  e1e_flush();
369  mdelay (10);
370 
371  ew32 ( TDBAH(0), 0 );
372  ew32 ( TDBAL(0), virt_to_bus ( adapter->tx_base ) );
373  ew32 ( TDLEN(0), adapter->tx_ring_size );
374 
375  DBG ( "E1000_TDBAL(0): %#08x\n", er32 ( TDBAL(0) ) );
376  DBG ( "E1000_TDLEN(0): %d\n", er32 ( TDLEN(0) ) );
377 
378  /* Setup the HW Tx Head and Tail descriptor pointers */
379  ew32 ( TDH(0), 0 );
380  ew32 ( TDT(0), 0 );
381 
382  adapter->tx_head = 0;
383  adapter->tx_tail = 0;
384  adapter->tx_fill_ctr = 0;
385 
386  txdctl = er32(TXDCTL(0));
387  txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
388  ew32 ( TXDCTL(0), txdctl );
389 
390  txdctl = er32 ( TXDCTL(0) );
391  txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
392  ew32 ( TXDCTL(0), txdctl );
393 
394  /* Setup Transmit Descriptor Settings for eop descriptor */
396 
397  /* Advanced descriptor */
398  adapter->txd_cmd |= E1000_ADVTXD_DCMD_DEXT;
399 
400  /* (not part of cmd, but in same 32 bit word...) */
401  adapter->txd_cmd |= E1000_ADVTXD_DTYP_DATA;
402 
403  /* enable Report Status bit */
404  adapter->txd_cmd |= E1000_ADVTXD_DCMD_RS;
405 
406  /* Program the Transmit Control Register */
407  tctl &= ~E1000_TCTL_CT;
408  tctl |= E1000_TCTL_PSP | E1000_TCTL_RTLC |
410 
412 
413  /* Enable transmits */
414  tctl |= E1000_TCTL_EN;
415  ew32(TCTL, tctl);
416  e1e_flush();
417 }
418 
419 /* igbvf_reset - bring the hardware into a known good state
420  *
421  * This function boots the hardware and enables some settings that
422  * require a configuration cycle of the hardware - those cannot be
423  * set/changed during runtime. After reset the device needs to be
424  * properly configured for Rx, Tx etc.
425  */
426 void igbvf_reset ( struct igbvf_adapter *adapter )
427 {
428  struct e1000_mac_info *mac = &adapter->hw.mac;
429  struct net_device *netdev = adapter->netdev;
430  struct e1000_hw *hw = &adapter->hw;
431 
432  /* Allow time for pending master requests to run */
433  if ( mac->ops.reset_hw(hw) )
434  DBG ("PF still resetting\n");
435 
436  mac->ops.init_hw ( hw );
437 
438  if ( is_valid_ether_addr(adapter->hw.mac.addr) ) {
439  memcpy ( netdev->hw_addr, adapter->hw.mac.addr, ETH_ALEN );
440  }
441 }
442 
443 extern void igbvf_init_function_pointers_vf(struct e1000_hw *hw);
444 
445 /**
446  * igbvf_sw_init - Initialize general software structures (struct igbvf_adapter)
447  * @adapter: board private structure to initialize
448  *
449  * igbvf_sw_init initializes the Adapter private data structure.
450  * Fields are initialized based on PCI device information and
451  * OS network device settings (MTU size).
452  **/
453 static int __devinit igbvf_sw_init ( struct igbvf_adapter *adapter )
454 {
455  struct e1000_hw *hw = &adapter->hw;
456  struct pci_device *pdev = adapter->pdev;
457  int rc;
458 
459  /* PCI config space info */
460 
461  hw->vendor_id = pdev->vendor;
462  hw->device_id = pdev->device;
463 
464  pci_read_config_byte ( pdev, PCI_REVISION, &hw->revision_id );
465 
466  pci_read_config_word ( pdev, PCI_COMMAND, &hw->bus.pci_cmd_word );
467 
469  adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
470 
471  /* Set various function pointers */
472  igbvf_init_function_pointers_vf ( &adapter->hw );
473 
474  rc = adapter->hw.mac.ops.init_params ( &adapter->hw );
475  if (rc) {
476  DBG ("hw.mac.ops.init_params(&adapter->hw) Failure\n");
477  return rc;
478  }
479 
480  rc = adapter->hw.mbx.ops.init_params ( &adapter->hw );
481  if (rc) {
482  DBG ("hw.mbx.ops.init_params(&adapter->hw) Failure\n");
483  return rc;
484  }
485 
486  /* Explicitly disable IRQ since the NIC can be in any state. */
487  igbvf_irq_disable ( adapter );
488 
489  return 0;
490 }
491 
492 /**
493  * igbvf_setup_srrctl - configure the receive control registers
494  * @adapter: Board private structure
495  **/
496 static void igbvf_setup_srrctl ( struct igbvf_adapter *adapter )
497 {
498  struct e1000_hw *hw = &adapter->hw;
499  u32 srrctl = 0;
500 
501  DBG ( "igbvf_setup_srrctl\n" );
502 
503  srrctl &= ~(E1000_SRRCTL_DESCTYPE_MASK |
506 
507  /* Enable queue drop to avoid head of line blocking */
508  srrctl |= E1000_SRRCTL_DROP_EN;
509 
510  /* Setup buffer sizes */
511  srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
513 
514  ew32 ( SRRCTL(0), srrctl );
515 }
516 
517 /**
518  * igbvf_configure_rx - Configure 8254x Receive Unit after Reset
519  * @adapter: board private structure
520  *
521  * Configure the Rx unit of the MAC after a reset.
522  **/
523 static void igbvf_configure_rx ( struct igbvf_adapter *adapter )
524 {
525  struct e1000_hw *hw = &adapter->hw;
526  u32 rxdctl;
527 
528  DBG ( "igbvf_configure_rx\n" );
529 
530  /* disable receives */
531  rxdctl = er32 ( RXDCTL(0) );
532  ew32 ( RXDCTL(0), rxdctl & ~E1000_RXDCTL_QUEUE_ENABLE );
533  msleep ( 10 );
534 
535  /*
536  * Setup the HW Rx Head and Tail Descriptor Pointers and
537  * the Base and Length of the Rx Descriptor Ring
538  */
539  ew32 ( RDBAL(0), virt_to_bus (adapter->rx_base) );
540  ew32 ( RDBAH(0), 0 );
541  ew32 ( RDLEN(0), adapter->rx_ring_size );
542  adapter->rx_curr = 0;
543  ew32 ( RDH(0), 0 );
544  ew32 ( RDT(0), 0 );
545 
546  rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
547  rxdctl &= 0xFFF00000;
548  rxdctl |= IGBVF_RX_PTHRESH;
549  rxdctl |= IGBVF_RX_HTHRESH << 8;
550  rxdctl |= IGBVF_RX_WTHRESH << 16;
551 
552  igbvf_rlpml_set_vf ( hw, adapter->max_frame_size );
553 
554  /* enable receives */
555  ew32 ( RXDCTL(0), rxdctl );
556  ew32 ( RDT(0), NUM_RX_DESC );
557 }
558 
559 /**
560  * igbvf_setup_rx_resources - allocate Rx resources (Descriptors)
561  *
562  * @v adapter e1000 private structure
563  **/
565 {
566  int i;
567  union e1000_adv_rx_desc *rx_curr_desc;
568  struct io_buffer *iob;
569 
570  DBG ( "igbvf_setup_rx_resources\n" );
571 
572  /* Allocate receive descriptor ring memory.
573  It must not cross a 64K boundary because of hardware errata
574  */
575 
576  adapter->rx_base =
577  malloc_phys ( adapter->rx_ring_size, adapter->rx_ring_size );
578 
579  if ( ! adapter->rx_base ) {
580  return -ENOMEM;
581  }
582  memset ( adapter->rx_base, 0, adapter->rx_ring_size );
583 
584  for ( i = 0; i < NUM_RX_DESC; i++ ) {
585  rx_curr_desc = adapter->rx_base + i;
587  adapter->rx_iobuf[i] = iob;
588  rx_curr_desc->wb.upper.status_error = 0;
589  if ( ! iob ) {
590  DBG ( "alloc_iob failed\n" );
591  return -ENOMEM;
592  } else {
593  rx_curr_desc->read.pkt_addr = virt_to_bus ( iob->data );
594  rx_curr_desc->read.hdr_addr = 0;
595  }
596  }
597 
598  return 0;
599 }
600 
601 /**
602  * igbvf_open - Called when a network interface is made active
603  * @netdev: network interface device structure
604  *
605  * Returns 0 on success, negative value on failure
606  *
607  * The open entry point is called when a network interface is made
608  * active by the system (IFF_UP). At this point all resources needed
609  * for transmit and receive operations are allocated, the interrupt
610  * handler is registered with the OS, the watchdog timer is started,
611  * and the stack is notified that the interface is ready.
612  **/
613 static int igbvf_open ( struct net_device *netdev )
614 {
615  struct igbvf_adapter *adapter = netdev->priv;
616  int err;
617 
618  DBG ("igbvf_open\n");
619 
620  /* Update MAC address */
621  memcpy ( adapter->hw.mac.addr, netdev->ll_addr, ETH_ALEN );
622  igbvf_reset( adapter );
623 
624  /* allocate transmit descriptors */
625  err = igbvf_setup_tx_resources ( adapter );
626  if (err) {
627  DBG ( "Error setting up TX resources!\n" );
628  goto err_setup_tx;
629  }
630 
631  igbvf_configure_tx ( adapter );
632 
633  igbvf_setup_srrctl( adapter );
634 
635  err = igbvf_setup_rx_resources( adapter );
636  if (err) {
637  DBG ( "Error setting up RX resources!\n" );
638  goto err_setup_rx;
639  }
640 
641  igbvf_configure_rx ( adapter );
642 
643  return 0;
644 
645 err_setup_rx:
646  DBG ( "err_setup_rx\n" );
647  igbvf_free_tx_resources ( adapter );
648  return err;
649 
650 err_setup_tx:
651  DBG ( "err_setup_tx\n" );
652  igbvf_reset ( adapter );
653 
654  return err;
655 }
656 
657 /**
658  * igbvf_close - Disables a network interface
659  * @netdev: network interface device structure
660  *
661  * Returns 0, this is not allowed to fail
662  *
663  * The close entry point is called when an interface is de-activated
664  * by the OS. The hardware is still under the drivers control, but
665  * needs to be disabled. A global MAC reset is issued to stop the
666  * hardware, and all transmit and receive resources are freed.
667  **/
668 static void igbvf_close ( struct net_device *netdev )
669 {
670  struct igbvf_adapter *adapter = netdev->priv;
671  struct e1000_hw *hw = &adapter->hw;
672  uint32_t rxdctl;
673 
674  DBG ( "igbvf_close\n" );
675 
676  /* Disable and acknowledge interrupts */
677  igbvf_irq_disable ( adapter );
678  er32(EICR);
679 
680  /* disable receives */
681  rxdctl = er32 ( RXDCTL(0) );
682  ew32 ( RXDCTL(0), rxdctl & ~E1000_RXDCTL_QUEUE_ENABLE );
683  mdelay ( 10 );
684 
685  igbvf_reset ( adapter );
686 
687  igbvf_free_tx_resources( adapter );
688  igbvf_free_rx_resources( adapter );
689 }
690 
691 /**
692  * igbvf_transmit - Transmit a packet
693  *
694  * @v netdev Network device
695  * @v iobuf I/O buffer
696  *
697  * @ret rc Returns 0 on success, negative on failure
698  */
699 static int igbvf_transmit ( struct net_device *netdev, struct io_buffer *iobuf )
700 {
701  struct igbvf_adapter *adapter = netdev->priv;
702  struct e1000_hw *hw = &adapter->hw;
703  uint32_t tx_curr = adapter->tx_tail;
704  union e1000_adv_tx_desc *tx_curr_desc;
705 
706  DBGP ("igbvf_transmit\n");
707 
708  if ( adapter->tx_fill_ctr == NUM_TX_DESC ) {
709  DBG ("TX overflow\n");
710  return -ENOBUFS;
711  }
712 
713  /* Save pointer to iobuf we have been given to transmit,
714  netdev_tx_complete() will need it later
715  */
716  adapter->tx_iobuf[tx_curr] = iobuf;
717 
718  tx_curr_desc = ( void * ) ( adapter->tx_base ) +
719  ( tx_curr * sizeof ( *adapter->tx_base ) );
720 
721  DBG ( "tx_curr_desc = %#08lx\n", virt_to_bus ( tx_curr_desc ) );
722  DBG ( "tx_curr_desc + 16 = %#08lx\n", virt_to_bus ( tx_curr_desc ) + 16 );
723  DBG ( "iobuf->data = %#08lx\n", virt_to_bus ( iobuf->data ) );
724 
725  /* Add the packet to TX ring
726  */
727  tx_curr_desc->read.buffer_addr = virt_to_bus ( iobuf->data );
728  tx_curr_desc->read.cmd_type_len = adapter->txd_cmd |(iob_len ( iobuf )) ;
729  // minus hdr_len ????
730  tx_curr_desc->read.olinfo_status = ((iob_len ( iobuf )) << E1000_ADVTXD_PAYLEN_SHIFT);
731 
732  DBG ( "TX fill: %d tx_curr: %d addr: %#08lx len: %zd\n", adapter->tx_fill_ctr,
733  tx_curr, virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
734 
735  /* Point to next free descriptor */
736  adapter->tx_tail = ( adapter->tx_tail + 1 ) % NUM_TX_DESC;
737  adapter->tx_fill_ctr++;
738 
739  /* Write new tail to NIC, making packet available for transmit
740  */
741  ew32 ( TDT(0), adapter->tx_tail );
742  e1e_flush ();
743 
744  return 0;
745 }
746 
747 /** igbvf net device operations */
749  .open = igbvf_open,
750  .close = igbvf_close,
751  .transmit = igbvf_transmit,
752  .poll = igbvf_poll,
753  .irq = igbvf_irq,
754 };
755 
756 /**
757  * igbvf_get_hw_control - get control of the h/w from f/w
758  * @adapter: address of board private structure
759  *
760  * igb_get_hw_control sets CTRL_EXT:DRV_LOAD bit.
761  * For ASF and Pass Through versions of f/w this means that
762  * the driver is loaded.
763  *
764  **/
765 void igbvf_get_hw_control ( struct igbvf_adapter *adapter )
766 {
767  struct e1000_hw *hw = &adapter->hw;
768  u32 ctrl_ext;
769 
770  /* Let firmware know the driver has taken over */
771  ctrl_ext = er32 ( CTRL_EXT );
772  ew32 ( CTRL_EXT, ctrl_ext | E1000_CTRL_EXT_DRV_LOAD );
773 }
774 
775 /**
776  * igbvf_probe - Device Initialization Routine
777  * @pdev: PCI device information struct
778  * @ent: entry in igbvf_pci_tbl
779  *
780  * Returns 0 on success, negative on failure
781  *
782  * igbvf_probe initializes an adapter identified by a pci_dev structure.
783  * The OS initialization, configuring of the adapter private structure,
784  * and a hardware reset occur.
785  **/
786 int igbvf_probe ( struct pci_device *pdev )
787 {
788  int err;
789  struct net_device *netdev;
790  struct igbvf_adapter *adapter;
791  unsigned long mmio_start, mmio_len;
792  struct e1000_hw *hw;
793 
794  DBG ( "igbvf_probe\n" );
795 
796  err = -ENOMEM;
797 
798  /* Allocate net device ( also allocates memory for netdev->priv
799  and makes netdev-priv point to it ) */
800  netdev = alloc_etherdev ( sizeof ( struct igbvf_adapter ) );
801  if ( ! netdev )
802  goto err_alloc_etherdev;
803 
804  /* Associate igbvf-specific network operations operations with
805  * generic network device layer */
807 
808  /* Associate this network device with given PCI device */
809  pci_set_drvdata ( pdev, netdev );
810  netdev->dev = &pdev->dev;
811 
812  /* Initialize driver private storage */
813  adapter = netdev->priv;
814  memset ( adapter, 0, ( sizeof ( *adapter ) ) );
815 
816  adapter->pdev = pdev;
817 
818  adapter->ioaddr = pdev->ioaddr;
819  adapter->hw.io_base = pdev->ioaddr;
820 
821  hw = &adapter->hw;
822  hw->vendor_id = pdev->vendor;
823  hw->device_id = pdev->device;
824 
825  adapter->irqno = pdev->irq;
826  adapter->netdev = netdev;
827  adapter->hw.back = adapter;
828 
829  adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
831 
832  adapter->tx_ring_size = sizeof ( *adapter->tx_base ) * NUM_TX_DESC;
833  adapter->rx_ring_size = sizeof ( *adapter->rx_base ) * NUM_RX_DESC;
834 
835  /* Fix up PCI device */
836  adjust_pci_device ( pdev );
837 
838  err = -EIO;
839 
840  mmio_start = pci_bar_start ( pdev, PCI_BASE_ADDRESS_0 );
841  mmio_len = pci_bar_size ( pdev, PCI_BASE_ADDRESS_0 );
842 
843  DBG ( "mmio_start: %#08lx\n", mmio_start );
844  DBG ( "mmio_len: %#08lx\n", mmio_len );
845 
846  adapter->hw.hw_addr = pci_ioremap ( pdev, mmio_start, mmio_len );
847  DBG ( "adapter->hw.hw_addr: %p\n", adapter->hw.hw_addr );
848 
849  if ( ! adapter->hw.hw_addr ) {
850  DBG ( "err_ioremap\n" );
851  goto err_ioremap;
852  }
853 
854  /* setup adapter struct */
855  err = igbvf_sw_init ( adapter );
856  if (err) {
857  DBG ( "err_sw_init\n" );
858  goto err_sw_init;
859  }
860 
861  /* reset the controller to put the device in a known good state */
862  err = hw->mac.ops.reset_hw ( hw );
863  if ( err ) {
864  DBG ("PF still in reset state, assigning new address\n");
865  netdev->hw_addr[0] = 0x21;
866  netdev->hw_addr[1] = 0x21;
867  netdev->hw_addr[2] = 0x21;
868  netdev->hw_addr[3] = 0x21;
869  netdev->hw_addr[4] = 0x21;
870  netdev->hw_addr[5] = 0x21;
871  netdev->hw_addr[6] = 0x21;
872  } else {
873  err = hw->mac.ops.read_mac_addr(hw);
874  if (err) {
875  DBG ("Error reading MAC address\n");
876  goto err_hw_init;
877  }
878  if ( ! is_valid_ether_addr(adapter->hw.mac.addr) ) {
879  /* Assign random MAC address */
880  eth_random_addr(adapter->hw.mac.addr);
881  }
882  }
883 
884  memcpy ( netdev->hw_addr, adapter->hw.mac.addr, ETH_ALEN );
885 
886  /* reset the hardware with the new settings */
887  igbvf_reset ( adapter );
888 
889  /* let the f/w know that the h/w is now under the control of the
890  * driver. */
891  igbvf_get_hw_control ( adapter );
892 
893  /* Mark as link up; we don't yet handle link state */
895 
896  if ( ( err = register_netdev ( netdev ) ) != 0) {
897  DBG ( "err_register\n" );
898  goto err_register;
899  }
900 
901  DBG ("igbvf_probe_succeeded\n");
902 
903  return 0;
904 
905 err_register:
906 err_hw_init:
907 err_sw_init:
908  iounmap ( adapter->hw.hw_addr );
909 err_ioremap:
910  netdev_put ( netdev );
911 err_alloc_etherdev:
912  return err;
913 }
914 
915 /**
916  * igbvf_remove - Device Removal Routine
917  * @pdev: PCI device information struct
918  *
919  * igbvf_remove is called by the PCI subsystem to alert the driver
920  * that it should release a PCI device. The could be caused by a
921  * Hot-Plug event, or because the driver is going to be removed from
922  * memory.
923  **/
924 void igbvf_remove ( struct pci_device *pdev )
925 {
926  struct net_device *netdev = pci_get_drvdata ( pdev );
927  struct igbvf_adapter *adapter = netdev->priv;
928 
929  DBG ( "igbvf_remove\n" );
930 
931  if ( adapter->hw.flash_address )
932  iounmap ( adapter->hw.flash_address );
933  if ( adapter->hw.hw_addr )
934  iounmap ( adapter->hw.hw_addr );
935 
937  igbvf_reset ( adapter );
939  netdev_put ( netdev );
940 }
941 
942 static struct pci_device_id igbvf_pci_tbl[] = {
943  PCI_ROM(0x8086, 0x10CA, "igbvf", "E1000_DEV_ID_82576_VF", 0),
944  PCI_ROM(0x8086, 0x1520, "i350vf", "E1000_DEV_ID_I350_VF", 0),
945 };
946 
947 
948 struct pci_driver igbvf_driver __pci_driver = {
949  .ids = igbvf_pci_tbl,
950  .id_count = (sizeof(igbvf_pci_tbl) / sizeof(igbvf_pci_tbl[0])),
951  .probe = igbvf_probe,
952  .remove = igbvf_remove,
953 };
struct pci_driver igbvf_driver __pci_driver
Definition: igbvf_main.c:948
void igbvf_get_hw_control(struct igbvf_adapter *adapter)
igbvf_get_hw_control - get control of the h/w from f/w @adapter: address of board private structure
Definition: igbvf_main.c:765
#define EINVAL
Invalid argument.
Definition: errno.h:428
uint8_t irq
Interrupt number.
Definition: pci.h:229
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
struct ath5k_hw_rx_error rx_err
Definition: desc.h:132
#define E1000_RXDCTL_QUEUE_ENABLE
Definition: igbvf_vf.h:63
uint32_t tx_tail
Definition: igbvf.h:293
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
Definition: netdevice.h:752
#define iob_put(iobuf, len)
Definition: iobuf.h:120
#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF
Definition: igbvf_vf.h:70
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
Definition: netdevice.c:586
union e1000_adv_tx_desc * tx_base
Definition: igbvf.h:286
A PCI driver.
Definition: pci.h:247
void igbvf_rlpml_set_vf(struct e1000_hw *hw, u16 max_size)
igbvf_rlpml_set_vf - Set the maximum receive packet length @hw: pointer to the HW structure @max_size...
Definition: igbvf_vf.c:331
struct pci_device * pdev
Definition: igbvf.h:269
int(* open)(struct net_device *netdev)
Open network device.
Definition: netdevice.h:222
uint32_t ioaddr
Definition: igbvf.h:298
#define msleep(x)
Definition: igbvf_osdep.h:49
unsigned long ioaddr
I/O address.
Definition: pci.h:221
u8 __iomem * flash_address
Definition: igbvf_vf.h:314
uint32_t tx_head
Definition: igbvf.h:292
static int __devinit igbvf_sw_init(struct igbvf_adapter *adapter)
igbvf_sw_init - Initialize general software structures (struct igbvf_adapter) @adapter: board private...
Definition: igbvf_main.c:453
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
Definition: iobuf.c:146
struct pci_device_id * ids
PCI ID table.
Definition: pci.h:249
static void igbvf_process_tx_packets(struct net_device *netdev)
igbvf_process_tx_packets - process transmitted packets
Definition: igbvf_main.c:198
struct e1000_mac_operations ops
Definition: igbvf_vf.h:225
#define E1000_CT_SHIFT
#define E1000_COLLISION_THRESHOLD
struct e1000_adv_tx_desc::@61 read
static void igbvf_irq_enable(struct igbvf_adapter *adapter)
igbvf_irq_enable - Enable default interrupt generation settings @adapter: board private structure
Definition: igbvf_main.c:165
uint32_t tx_ring_size
Definition: igbvf.h:289
#define E1000_RXDEXT_ERR_FRAME_ERR_MASK
uint32_t rx_curr
Definition: igbvf.h:296
static void *__malloc malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
Definition: malloc.h:62
#define PCI_BASE_ADDRESS_0
Definition: pci.h:62
int pci_read_config_word(struct pci_device *pci, unsigned int where, uint16_t *value)
Read 16-bit word from PCI configuration space.
#define PCI_COMMAND
PCI command.
Definition: pci.h:25
#define E1000_TCTL_COLD
uint8_t mac[ETH_ALEN]
MAC address.
Definition: ena.h:24
#define E1000_TCTL_RTLC
#define E1000_SRRCTL_BSIZEPKT_MASK
Definition: igbvf_vf.h:78
#define MAXIMUM_ETHERNET_VLAN_SIZE
Definition: igbvf.h:77
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
Definition: pci.c:154
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
Definition: iobuf.c:129
struct e1000_adv_rx_desc::@53 read
struct device dev
Generic device.
Definition: pci.h:208
Definition: hw.c:16
#define NUM_RX_DESC
Definition: igbvf.h:281
void igbvf_free_tx_resources(struct igbvf_adapter *adapter)
igbvf_free_tx_resources - Free Tx Resources per Queue @adapter: board private structure
Definition: igbvf_main.c:77
int igbvf_setup_rx_resources(struct igbvf_adapter *adapter)
igbvf_setup_rx_resources - allocate Rx resources (Descriptors)
Definition: igbvf_main.c:564
#define E1000_ADVTXD_DCMD_EOP
Definition: igbvf_vf.h:145
#define IMS_ENABLE_MASK
#define IGBVF_RX_PTHRESH
Definition: igbvf.h:68
struct e1000_adv_rx_desc::@54 wb
void igbvf_free_rx_resources(struct igbvf_adapter *adapter)
igbvf_free_rx_resources - Free Rx Resources @adapter: board private structure
Definition: igbvf_main.c:90
static void igbvf_irq(struct net_device *netdev, int enable)
igbvf_irq - enable or Disable interrupts
Definition: igbvf_main.c:180
struct e1000_mbx_operations ops
Definition: igbvf_vf.h:298
static void igbvf_setup_srrctl(struct igbvf_adapter *adapter)
igbvf_setup_srrctl - configure the receive control registers @adapter: Board private structure
Definition: igbvf_main.c:496
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
Definition: netdevice.h:515
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
Definition: pci.h:359
#define ENOMEM
Not enough space.
Definition: errno.h:534
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint32_t rx_ring_size
Definition: igbvf.h:290
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition: io.h:183
uint16_t device
Device ID.
Definition: pci.h:225
#define ETH_HLEN
Definition: if_ether.h:9
#define DBGP(...)
Definition: compiler.h:532
#define E1000_ADVTXD_DCMD_DEXT
Definition: igbvf_vf.h:148
static int igbvf_transmit(struct net_device *netdev, struct io_buffer *iobuf)
igbvf_transmit - Transmit a packet
Definition: igbvf_main.c:699
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
Definition: netdevice.h:572
static void igbvf_close(struct net_device *netdev)
igbvf_close - Disables a network interface @netdev: network interface device structure
Definition: igbvf_main.c:668
#define ETH_FRAME_LEN
Definition: if_ether.h:11
static struct net_device_operations igbvf_operations
igbvf net device operations
Definition: igbvf_main.c:748
void * priv
Driver private data.
Definition: netdevice.h:431
struct e1000_adv_rx_desc::@54::@56 upper
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
Definition: netdevice.h:774
struct e1000_mac_info mac
Definition: igbvf_vf.h:317
#define E1000_CTRL_EXT_DRV_LOAD
static struct net_device * netdev
Definition: gdbudp.c:52
unsigned long pci_bar_start(struct pci_device *pci, unsigned int reg)
Find the start of a PCI BAR.
Definition: pci.c:96
struct e1000_mbx_info mbx
Definition: igbvf_vf.h:319
#define E1000_SRRCTL_BSIZEPKT_SHIFT
Definition: igbvf_vf.h:66
void unregister_netdev(struct net_device *netdev)
Unregister network device.
Definition: netdevice.c:941
u32 max_hw_frame_size
Definition: igbvf.h:278
static void igbvf_process_rx_packets(struct net_device *netdev)
igbvf_process_rx_packets - process received packets
Definition: igbvf_main.c:244
int igbvf_probe(struct pci_device *pdev)
igbvf_probe - Device Initialization Routine @pdev: PCI device information struct @ent: entry in igbvf...
Definition: igbvf_main.c:786
struct net_device * netdev
Definition: igbvf.h:268
unsigned long pci_bar_size(struct pci_device *pci, unsigned int reg)
Find the size of a PCI BAR.
Definition: pciextra.c:92
#define E1000_ADVTXD_DTYP_DATA
Definition: igbvf_vf.h:144
FILE_LICENCE(GPL2_ONLY)
struct e1000_hw hw
Definition: igbvf.h:273
A PCI device.
Definition: pci.h:206
int register_netdev(struct net_device *netdev)
Register network device.
Definition: netdevice.c:759
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
Definition: iobuf.h:155
#define IGBVF_RX_HTHRESH
Definition: igbvf.h:69
A network device.
Definition: netdevice.h:352
void igbvf_config_collision_dist(struct e1000_hw *hw)
igbvf_config_collision_dist_generic - Configure collision distance @hw: pointer to the HW structure
Definition: igbvf_main.c:337
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
Definition: netdevice.h:528
#define E1000_ADVTXD_DCMD_RS
Definition: igbvf_vf.h:147
unsigned long io_base
Definition: igbvf_vf.h:315
struct e1000_adv_tx_desc::@62 wb
#define er32(reg)
Definition: igbvf.h:373
#define E1000_TCTL_PSP
#define ETH_ALEN
Definition: if_ether.h:8
#define ETH_ZLEN
Definition: if_ether.h:10
A PCI device ID list entry.
Definition: pci.h:170
unsigned int uint32_t
Definition: stdint.h:12
u32 min_frame_size
Definition: igbvf.h:275
static int is_valid_ether_addr(const void *addr)
Check if Ethernet address is valid.
Definition: ethernet.h:77
static struct xen_remove_from_physmap * remove
Definition: xenmem.h:39
uint16_t vendor
Vendor ID.
Definition: pci.h:223
#define E1000_ADVTXD_DCMD_IFCS
Definition: igbvf_vf.h:146
#define E1000_TCTL_EN
Network device operations.
Definition: netdevice.h:213
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
Definition: netdevice.c:548
struct device * dev
Underlying hardware device.
Definition: netdevice.h:364
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
Definition: pci.h:369
u8 __iomem * hw_addr
Definition: igbvf_vf.h:313
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78
#define IGBVF_RX_WTHRESH
Definition: igbvf.h:70
static void igbvf_configure_rx(struct igbvf_adapter *adapter)
igbvf_configure_rx - Configure 8254x Receive Unit after Reset @adapter: board private structure
Definition: igbvf_main.c:523
#define E1000_TXD_STAT_DD
#define __devinit
Definition: igbvf_osdep.h:46
#define E1000_SRRCTL_BSIZEHDR_MASK
Definition: igbvf_vf.h:79
#define E1000_SRRCTL_DESCTYPE_MASK
Definition: igbvf_vf.h:75
#define ENOBUFS
No buffer space available.
Definition: errno.h:498
static int igbvf_refill_rx_ring(struct igbvf_adapter *adapter)
igbvf_refill_rx_ring - allocate Rx io_buffers
Definition: igbvf_main.c:110
int(* probe)(struct pci_device *pci)
Probe device.
Definition: pci.h:260
#define E1000_TCTL_CT
void * back
Definition: igbvf_vf.h:311
#define e1e_flush()
Definition: igbvf.h:375
void * data
Start of data.
Definition: iobuf.h:48
#define ew32(reg, val)
Definition: igbvf.h:374
#define E1000_ADVTXD_PAYLEN_SHIFT
Definition: igbvf_vf.h:151
#define EIO
Input/output error.
Definition: errno.h:433
#define E1000_RXD_STAT_DD
struct io_buffer * tx_iobuf[NUM_TX_DESC]
Definition: igbvf.h:283
static void igbvf_configure_tx(struct igbvf_adapter *adapter)
igbvf_configure_tx - Configure Transmit Unit after Reset @adapter: board private structure
Definition: igbvf_main.c:358
s32(* init_params)(struct e1000_hw *hw)
Definition: igbvf_vf.h:278
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
Definition: ethernet.c:264
#define ETH_FCS_LEN
Definition: atl1e.h:45
void iounmap(volatile const void *io_addr)
Unmap I/O address.
#define PCI_REVISION
PCI revision.
Definition: pci.h:44
void igbvf_remove(struct pci_device *pdev)
igbvf_remove - Device Removal Routine @pdev: PCI device information struct
Definition: igbvf_main.c:924
#define E1000_TXDCTL_QUEUE_ENABLE
Definition: igbvf_vf.h:62
uint32_t irqno
Definition: igbvf.h:299
static void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
Definition: malloc.h:77
static void igbvf_poll(struct net_device *netdev)
igbvf_poll - Poll for received packets
Definition: igbvf_main.c:307
static void igbvf_irq_disable(struct igbvf_adapter *adapter)
igbvf_irq_disable - Mask off interrupt generation on the NIC @adapter: board private structure
Definition: igbvf_main.c:154
static struct pci_device_id igbvf_pci_tbl[]
Definition: igbvf_main.c:942
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
Definition: netdevice.h:387
static int igbvf_open(struct net_device *netdev)
igbvf_open - Called when a network interface is made active @netdev: network interface device structu...
Definition: igbvf_main.c:613
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
#define E1000_SRRCTL_DROP_EN
Definition: igbvf_vf.h:76
uint32_t txd_cmd
Definition: igbvf.h:303
#define E1000_COLD_SHIFT
u32 max_frame_size
Definition: igbvf.h:276
#define NUM_TX_DESC
Definition: igbvf.h:280
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
Definition: netdevice.h:381
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
#define PCI_ROM(_vendor, _device, _name, _description, _data)
Definition: pci.h:303
union e1000_adv_rx_desc * rx_base
Definition: igbvf.h:287
void eth_random_addr(void *hw_addr)
Generate random Ethernet address.
Definition: ethernet.c:159
uint32_t u32
Definition: stdint.h:23
void igbvf_reset(struct igbvf_adapter *adapter)
Definition: igbvf_main.c:426
int igbvf_setup_tx_resources(struct igbvf_adapter *adapter)
igbvf_setup_tx_resources - allocate Tx resources (Descriptors)
Definition: igbvf_main.c:43
uint32_t tx_fill_ctr
Definition: igbvf.h:294
#define DBG2(...)
Definition: compiler.h:515
struct io_buffer * rx_iobuf[NUM_RX_DESC]
Definition: igbvf.h:284
#define E1000_COLLISION_DISTANCE
void * memset(void *dest, int character, size_t len) __nonnull
int pci_read_config_byte(struct pci_device *pci, unsigned int where, uint8_t *value)
Read byte from PCI configuration space.
A persistent I/O buffer.
Definition: iobuf.h:33
s32(* init_params)(struct e1000_hw *)
Definition: igbvf_vf.h:209
void igbvf_init_function_pointers_vf(struct e1000_hw *hw)
igbvf_init_function_pointers_vf - Inits function pointers @hw: pointer to the HW structure
Definition: igbvf_vf.c:83