Browse Source

[intelxl] Expose functions required by virtual function driver

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 5 years ago
parent
commit
3078a952a8
2 changed files with 32 additions and 17 deletions
  1. 14
    17
      src/drivers/net/intelxl.c
  2. 18
    0
      src/drivers/net/intelxl.h

+ 14
- 17
src/drivers/net/intelxl.c View File

45
  *
45
  *
46
  */
46
  */
47
 
47
 
48
-static void intelxl_reopen_admin ( struct intelxl_nic *intelxl );
49
-
50
 /******************************************************************************
48
 /******************************************************************************
51
  *
49
  *
52
  * Device reset
50
  * Device reset
238
  * @v intelxl		Intel device
236
  * @v intelxl		Intel device
239
  * @ret cmd		Command descriptor
237
  * @ret cmd		Command descriptor
240
  */
238
  */
241
-static struct intelxl_admin_descriptor *
239
+struct intelxl_admin_descriptor *
242
 intelxl_admin_command_descriptor ( struct intelxl_nic *intelxl ) {
240
 intelxl_admin_command_descriptor ( struct intelxl_nic *intelxl ) {
243
 	struct intelxl_admin *admin = &intelxl->command;
241
 	struct intelxl_admin *admin = &intelxl->command;
244
 	struct intelxl_admin_descriptor *cmd;
242
 	struct intelxl_admin_descriptor *cmd;
255
  * @v intelxl		Intel device
253
  * @v intelxl		Intel device
256
  * @ret buf		Data buffer
254
  * @ret buf		Data buffer
257
  */
255
  */
258
-static union intelxl_admin_buffer *
256
+union intelxl_admin_buffer *
259
 intelxl_admin_command_buffer ( struct intelxl_nic *intelxl ) {
257
 intelxl_admin_command_buffer ( struct intelxl_nic *intelxl ) {
260
 	struct intelxl_admin *admin = &intelxl->command;
258
 	struct intelxl_admin *admin = &intelxl->command;
261
 	union intelxl_admin_buffer *buf;
259
 	union intelxl_admin_buffer *buf;
295
  * @v intelxl		Intel device
293
  * @v intelxl		Intel device
296
  * @ret rc		Return status code
294
  * @ret rc		Return status code
297
  */
295
  */
298
-static int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
296
+int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
299
 	struct intelxl_admin *admin = &intelxl->command;
297
 	struct intelxl_admin *admin = &intelxl->command;
300
 	const struct intelxl_admin_offsets *regs = admin->regs;
298
 	const struct intelxl_admin_offsets *regs = admin->regs;
301
 	void *admin_regs = ( intelxl->regs + admin->base );
299
 	void *admin_regs = ( intelxl->regs + admin->base );
696
  *
694
  *
697
  * @v netdev		Network device
695
  * @v netdev		Network device
698
  */
696
  */
699
-static void intelxl_poll_admin ( struct net_device *netdev ) {
697
+void intelxl_poll_admin ( struct net_device *netdev ) {
700
 	struct intelxl_nic *intelxl = netdev->priv;
698
 	struct intelxl_nic *intelxl = netdev->priv;
701
 	struct intelxl_admin *admin = &intelxl->event;
699
 	struct intelxl_admin *admin = &intelxl->event;
702
 	struct intelxl_admin_descriptor *evt;
700
 	struct intelxl_admin_descriptor *evt;
749
  * @v intelxl		Intel device
747
  * @v intelxl		Intel device
750
  * @ret rc		Return status code
748
  * @ret rc		Return status code
751
  */
749
  */
752
-static int intelxl_open_admin ( struct intelxl_nic *intelxl ) {
750
+int intelxl_open_admin ( struct intelxl_nic *intelxl ) {
753
 	int rc;
751
 	int rc;
754
 
752
 
755
 	/* Allocate admin event queue */
753
 	/* Allocate admin event queue */
789
  *
787
  *
790
  * @v intelxl		Intel device
788
  * @v intelxl		Intel device
791
  */
789
  */
792
-static void intelxl_reopen_admin ( struct intelxl_nic *intelxl ) {
790
+void intelxl_reopen_admin ( struct intelxl_nic *intelxl ) {
793
 	unsigned int i;
791
 	unsigned int i;
794
 
792
 
795
 	/* Enable admin event queue */
793
 	/* Enable admin event queue */
811
  *
809
  *
812
  * @v intelxl		Intel device
810
  * @v intelxl		Intel device
813
  */
811
  */
814
-static void intelxl_close_admin ( struct intelxl_nic *intelxl ) {
812
+void intelxl_close_admin ( struct intelxl_nic *intelxl ) {
815
 
813
 
816
 	/* Shut down admin queues */
814
 	/* Shut down admin queues */
817
 	intelxl_admin_shutdown ( intelxl );
815
 	intelxl_admin_shutdown ( intelxl );
839
  * @v ring		Descriptor ring
837
  * @v ring		Descriptor ring
840
  * @ret rc		Return status code
838
  * @ret rc		Return status code
841
  */
839
  */
842
-static int intelxl_alloc_ring ( struct intelxl_nic *intelxl,
843
-				struct intelxl_ring *ring ) {
840
+int intelxl_alloc_ring ( struct intelxl_nic *intelxl,
841
+			 struct intelxl_ring *ring ) {
844
 	physaddr_t address;
842
 	physaddr_t address;
845
 	int rc;
843
 	int rc;
846
 
844
 
880
  * @v intelxl		Intel device
878
  * @v intelxl		Intel device
881
  * @v ring		Descriptor ring
879
  * @v ring		Descriptor ring
882
  */
880
  */
883
-static void intelxl_free_ring ( struct intelxl_nic *intelxl __unused,
884
-				struct intelxl_ring *ring ) {
881
+void intelxl_free_ring ( struct intelxl_nic *intelxl __unused,
882
+			 struct intelxl_ring *ring ) {
885
 
883
 
886
 	/* Free descriptor ring */
884
 	/* Free descriptor ring */
887
 	free_dma ( ring->desc.raw, ring->len );
885
 	free_dma ( ring->desc.raw, ring->len );
1253
  *
1251
  *
1254
  * @v intelxl		Intel device
1252
  * @v intelxl		Intel device
1255
  */
1253
  */
1256
-static void intelxl_empty_rx ( struct intelxl_nic *intelxl ) {
1254
+void intelxl_empty_rx ( struct intelxl_nic *intelxl ) {
1257
 	unsigned int i;
1255
 	unsigned int i;
1258
 
1256
 
1259
 	/* Discard any unused receive buffers */
1257
 	/* Discard any unused receive buffers */
1381
  * @v iobuf		I/O buffer
1379
  * @v iobuf		I/O buffer
1382
  * @ret rc		Return status code
1380
  * @ret rc		Return status code
1383
  */
1381
  */
1384
-static int intelxl_transmit ( struct net_device *netdev,
1385
-			      struct io_buffer *iobuf ) {
1382
+int intelxl_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) {
1386
 	struct intelxl_nic *intelxl = netdev->priv;
1383
 	struct intelxl_nic *intelxl = netdev->priv;
1387
 	struct intelxl_tx_data_descriptor *tx;
1384
 	struct intelxl_tx_data_descriptor *tx;
1388
 	unsigned int tx_idx;
1385
 	unsigned int tx_idx;
1504
  *
1501
  *
1505
  * @v netdev		Network device
1502
  * @v netdev		Network device
1506
  */
1503
  */
1507
-static void intelxl_poll ( struct net_device *netdev ) {
1504
+void intelxl_poll ( struct net_device *netdev ) {
1508
 	struct intelxl_nic *intelxl = netdev->priv;
1505
 	struct intelxl_nic *intelxl = netdev->priv;
1509
 
1506
 
1510
 	/* Acknowledge interrupts, if applicable */
1507
 	/* Acknowledge interrupts, if applicable */

+ 18
- 0
src/drivers/net/intelxl.h View File

851
 	struct io_buffer *rx_iobuf[INTELXL_RX_NUM_DESC];
851
 	struct io_buffer *rx_iobuf[INTELXL_RX_NUM_DESC];
852
 };
852
 };
853
 
853
 
854
+extern struct intelxl_admin_descriptor *
855
+intelxl_admin_command_descriptor ( struct intelxl_nic *intelxl );
856
+extern union intelxl_admin_buffer *
857
+intelxl_admin_command_buffer ( struct intelxl_nic *intelxl );
858
+extern int intelxl_admin_command ( struct intelxl_nic *intelxl );
859
+extern void intelxl_poll_admin ( struct net_device *netdev );
860
+extern int intelxl_open_admin ( struct intelxl_nic *intelxl );
861
+extern void intelxl_reopen_admin ( struct intelxl_nic *intelxl );
862
+extern void intelxl_close_admin ( struct intelxl_nic *intelxl );
863
+extern int intelxl_alloc_ring ( struct intelxl_nic *intelxl,
864
+				struct intelxl_ring *ring );
865
+extern void intelxl_free_ring ( struct intelxl_nic *intelxl,
866
+				struct intelxl_ring *ring );
867
+extern void intelxl_empty_rx ( struct intelxl_nic *intelxl );
868
+extern int intelxl_transmit ( struct net_device *netdev,
869
+			      struct io_buffer *iobuf );
870
+extern void intelxl_poll ( struct net_device *netdev );
871
+
854
 extern void intelxlvf_admin_event ( struct net_device *netdev,
872
 extern void intelxlvf_admin_event ( struct net_device *netdev,
855
 				    struct intelxl_admin_descriptor *evt,
873
 				    struct intelxl_admin_descriptor *evt,
856
 				    union intelxl_admin_buffer *buf );
874
 				    union intelxl_admin_buffer *buf );

Loading…
Cancel
Save