diff options
Diffstat (limited to 'drivers/net/vxge/vxge-config.c')
-rw-r--r-- | drivers/net/vxge/vxge-config.c | 100 |
1 files changed, 23 insertions, 77 deletions
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c index 14dc8c8f47ef..409c2e6053d0 100644 --- a/drivers/net/vxge/vxge-config.c +++ b/drivers/net/vxge/vxge-config.c | |||
@@ -22,19 +22,6 @@ | |||
22 | #include "vxge-main.h" | 22 | #include "vxge-main.h" |
23 | 23 | ||
24 | static enum vxge_hw_status | 24 | static enum vxge_hw_status |
25 | __vxge_hw_fifo_create( | ||
26 | struct __vxge_hw_vpath_handle *vpath_handle, | ||
27 | struct vxge_hw_fifo_attr *attr); | ||
28 | |||
29 | static enum vxge_hw_status | ||
30 | __vxge_hw_fifo_abort( | ||
31 | struct __vxge_hw_fifo *fifoh); | ||
32 | |||
33 | static enum vxge_hw_status | ||
34 | __vxge_hw_fifo_reset( | ||
35 | struct __vxge_hw_fifo *ringh); | ||
36 | |||
37 | static enum vxge_hw_status | ||
38 | __vxge_hw_fifo_delete( | 25 | __vxge_hw_fifo_delete( |
39 | struct __vxge_hw_vpath_handle *vpath_handle); | 26 | struct __vxge_hw_vpath_handle *vpath_handle); |
40 | 27 | ||
@@ -72,44 +59,15 @@ __vxge_hw_blockpool_free(struct __vxge_hw_device *hldev, | |||
72 | u32 size, | 59 | u32 size, |
73 | struct vxge_hw_mempool_dma *dma_object); | 60 | struct vxge_hw_mempool_dma *dma_object); |
74 | 61 | ||
75 | |||
76 | static struct __vxge_hw_channel* | ||
77 | __vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph, | ||
78 | enum __vxge_hw_channel_type type, u32 length, | ||
79 | u32 per_dtr_space, void *userdata); | ||
80 | |||
81 | static void | 62 | static void |
82 | __vxge_hw_channel_free( | 63 | __vxge_hw_channel_free( |
83 | struct __vxge_hw_channel *channel); | 64 | struct __vxge_hw_channel *channel); |
84 | 65 | ||
85 | static enum vxge_hw_status | ||
86 | __vxge_hw_channel_initialize( | ||
87 | struct __vxge_hw_channel *channel); | ||
88 | |||
89 | static enum vxge_hw_status | ||
90 | __vxge_hw_channel_reset( | ||
91 | struct __vxge_hw_channel *channel); | ||
92 | |||
93 | static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp); | 66 | static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp); |
94 | 67 | ||
95 | static enum vxge_hw_status | 68 | static enum vxge_hw_status |
96 | __vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config); | ||
97 | |||
98 | static enum vxge_hw_status | ||
99 | __vxge_hw_device_config_check(struct vxge_hw_device_config *new_config); | 69 | __vxge_hw_device_config_check(struct vxge_hw_device_config *new_config); |
100 | 70 | ||
101 | static void | ||
102 | __vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev); | ||
103 | |||
104 | static enum vxge_hw_status | ||
105 | __vxge_hw_device_initialize(struct __vxge_hw_device *hldev); | ||
106 | |||
107 | static void | ||
108 | __vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev); | ||
109 | |||
110 | static enum vxge_hw_status | ||
111 | __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev); | ||
112 | |||
113 | static enum vxge_hw_status | 71 | static enum vxge_hw_status |
114 | __vxge_hw_device_register_poll( | 72 | __vxge_hw_device_register_poll( |
115 | void __iomem *reg, | 73 | void __iomem *reg, |
@@ -130,9 +88,10 @@ __vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr, | |||
130 | 88 | ||
131 | static struct vxge_hw_mempool* | 89 | static struct vxge_hw_mempool* |
132 | __vxge_hw_mempool_create(struct __vxge_hw_device *devh, u32 memblock_size, | 90 | __vxge_hw_mempool_create(struct __vxge_hw_device *devh, u32 memblock_size, |
133 | u32 item_size, u32 private_size, u32 items_initial, | 91 | u32 item_size, u32 private_size, u32 items_initial, |
134 | u32 items_max, struct vxge_hw_mempool_cbs *mp_callback, | 92 | u32 items_max, struct vxge_hw_mempool_cbs *mp_callback, |
135 | void *userdata); | 93 | void *userdata); |
94 | |||
136 | static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool); | 95 | static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool); |
137 | 96 | ||
138 | static enum vxge_hw_status | 97 | static enum vxge_hw_status |
@@ -145,24 +104,10 @@ vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vpath_handle); | |||
145 | static enum vxge_hw_status | 104 | static enum vxge_hw_status |
146 | __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg); | 105 | __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg); |
147 | 106 | ||
148 | static enum vxge_hw_status | ||
149 | __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath); | ||
150 | |||
151 | |||
152 | static enum vxge_hw_status | ||
153 | __vxge_hw_vpath_sw_reset(struct __vxge_hw_device *devh, u32 vp_id); | ||
154 | |||
155 | static enum vxge_hw_status | ||
156 | __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *devh, u32 vp_id); | ||
157 | |||
158 | static void | 107 | static void |
159 | __vxge_hw_vp_terminate(struct __vxge_hw_device *devh, u32 vp_id); | 108 | __vxge_hw_vp_terminate(struct __vxge_hw_device *devh, u32 vp_id); |
160 | 109 | ||
161 | static enum vxge_hw_status | 110 | static enum vxge_hw_status |
162 | __vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath, | ||
163 | u32 operation, u32 offset, u64 *stat); | ||
164 | |||
165 | static enum vxge_hw_status | ||
166 | __vxge_hw_vpath_xmac_tx_stats_get(struct __vxge_hw_virtualpath *vpath, | 111 | __vxge_hw_vpath_xmac_tx_stats_get(struct __vxge_hw_virtualpath *vpath, |
167 | struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats); | 112 | struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats); |
168 | 113 | ||
@@ -505,7 +450,7 @@ vxge_hw_vpath_eprom_img_ver_get(struct __vxge_hw_device *hldev, | |||
505 | * This function allocates required memory for the channel and various arrays | 450 | * This function allocates required memory for the channel and various arrays |
506 | * in the channel | 451 | * in the channel |
507 | */ | 452 | */ |
508 | struct __vxge_hw_channel* | 453 | static struct __vxge_hw_channel * |
509 | __vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph, | 454 | __vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph, |
510 | enum __vxge_hw_channel_type type, | 455 | enum __vxge_hw_channel_type type, |
511 | u32 length, u32 per_dtr_space, void *userdata) | 456 | u32 length, u32 per_dtr_space, void *userdata) |
@@ -576,7 +521,7 @@ exit0: | |||
576 | * This function deallocates memory from the channel and various arrays | 521 | * This function deallocates memory from the channel and various arrays |
577 | * in the channel | 522 | * in the channel |
578 | */ | 523 | */ |
579 | void __vxge_hw_channel_free(struct __vxge_hw_channel *channel) | 524 | static void __vxge_hw_channel_free(struct __vxge_hw_channel *channel) |
580 | { | 525 | { |
581 | kfree(channel->work_arr); | 526 | kfree(channel->work_arr); |
582 | kfree(channel->free_arr); | 527 | kfree(channel->free_arr); |
@@ -590,7 +535,7 @@ void __vxge_hw_channel_free(struct __vxge_hw_channel *channel) | |||
590 | * This function initializes a channel by properly setting the | 535 | * This function initializes a channel by properly setting the |
591 | * various references | 536 | * various references |
592 | */ | 537 | */ |
593 | enum vxge_hw_status | 538 | static enum vxge_hw_status |
594 | __vxge_hw_channel_initialize(struct __vxge_hw_channel *channel) | 539 | __vxge_hw_channel_initialize(struct __vxge_hw_channel *channel) |
595 | { | 540 | { |
596 | u32 i; | 541 | u32 i; |
@@ -625,7 +570,7 @@ __vxge_hw_channel_initialize(struct __vxge_hw_channel *channel) | |||
625 | * __vxge_hw_channel_reset - Resets a channel | 570 | * __vxge_hw_channel_reset - Resets a channel |
626 | * This function resets a channel by properly setting the various references | 571 | * This function resets a channel by properly setting the various references |
627 | */ | 572 | */ |
628 | enum vxge_hw_status | 573 | static enum vxge_hw_status |
629 | __vxge_hw_channel_reset(struct __vxge_hw_channel *channel) | 574 | __vxge_hw_channel_reset(struct __vxge_hw_channel *channel) |
630 | { | 575 | { |
631 | u32 i; | 576 | u32 i; |
@@ -652,8 +597,7 @@ __vxge_hw_channel_reset(struct __vxge_hw_channel *channel) | |||
652 | * Initialize certain PCI/PCI-X configuration registers | 597 | * Initialize certain PCI/PCI-X configuration registers |
653 | * with recommended values. Save config space for future hw resets. | 598 | * with recommended values. Save config space for future hw resets. |
654 | */ | 599 | */ |
655 | void | 600 | static void __vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev) |
656 | __vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev) | ||
657 | { | 601 | { |
658 | u16 cmd = 0; | 602 | u16 cmd = 0; |
659 | 603 | ||
@@ -742,7 +686,7 @@ exit: | |||
742 | * register location pointers in the device object. It waits until the ric is | 686 | * register location pointers in the device object. It waits until the ric is |
743 | * completed initializing registers. | 687 | * completed initializing registers. |
744 | */ | 688 | */ |
745 | enum vxge_hw_status | 689 | static enum vxge_hw_status |
746 | __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev) | 690 | __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev) |
747 | { | 691 | { |
748 | u64 val64; | 692 | u64 val64; |
@@ -938,7 +882,8 @@ __vxge_hw_verify_pci_e_info(struct __vxge_hw_device *hldev) | |||
938 | * __vxge_hw_device_initialize | 882 | * __vxge_hw_device_initialize |
939 | * Initialize Titan-V hardware. | 883 | * Initialize Titan-V hardware. |
940 | */ | 884 | */ |
941 | enum vxge_hw_status __vxge_hw_device_initialize(struct __vxge_hw_device *hldev) | 885 | static enum vxge_hw_status |
886 | __vxge_hw_device_initialize(struct __vxge_hw_device *hldev) | ||
942 | { | 887 | { |
943 | enum vxge_hw_status status = VXGE_HW_OK; | 888 | enum vxge_hw_status status = VXGE_HW_OK; |
944 | 889 | ||
@@ -2337,7 +2282,7 @@ static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool) | |||
2337 | * __vxge_hw_device_fifo_config_check - Check fifo configuration. | 2282 | * __vxge_hw_device_fifo_config_check - Check fifo configuration. |
2338 | * Check the fifo configuration | 2283 | * Check the fifo configuration |
2339 | */ | 2284 | */ |
2340 | enum vxge_hw_status | 2285 | static enum vxge_hw_status |
2341 | __vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config) | 2286 | __vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config) |
2342 | { | 2287 | { |
2343 | if ((fifo_config->fifo_blocks < VXGE_HW_MIN_FIFO_BLOCKS) || | 2288 | if ((fifo_config->fifo_blocks < VXGE_HW_MIN_FIFO_BLOCKS) || |
@@ -2385,7 +2330,7 @@ __vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config) | |||
2385 | * __vxge_hw_device_config_check - Check device configuration. | 2330 | * __vxge_hw_device_config_check - Check device configuration. |
2386 | * Check the device configuration | 2331 | * Check the device configuration |
2387 | */ | 2332 | */ |
2388 | enum vxge_hw_status | 2333 | static enum vxge_hw_status |
2389 | __vxge_hw_device_config_check(struct vxge_hw_device_config *new_config) | 2334 | __vxge_hw_device_config_check(struct vxge_hw_device_config *new_config) |
2390 | { | 2335 | { |
2391 | u32 i; | 2336 | u32 i; |
@@ -2945,7 +2890,7 @@ __vxge_hw_fifo_mempool_item_alloc( | |||
2945 | * __vxge_hw_fifo_create - Create a FIFO | 2890 | * __vxge_hw_fifo_create - Create a FIFO |
2946 | * This function creates FIFO and initializes it. | 2891 | * This function creates FIFO and initializes it. |
2947 | */ | 2892 | */ |
2948 | enum vxge_hw_status | 2893 | static enum vxge_hw_status |
2949 | __vxge_hw_fifo_create(struct __vxge_hw_vpath_handle *vp, | 2894 | __vxge_hw_fifo_create(struct __vxge_hw_vpath_handle *vp, |
2950 | struct vxge_hw_fifo_attr *attr) | 2895 | struct vxge_hw_fifo_attr *attr) |
2951 | { | 2896 | { |
@@ -3109,7 +3054,8 @@ static enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo) | |||
3109 | * __vxge_hw_fifo_delete - Removes the FIFO | 3054 | * __vxge_hw_fifo_delete - Removes the FIFO |
3110 | * This function freeup the memory pool and removes the FIFO | 3055 | * This function freeup the memory pool and removes the FIFO |
3111 | */ | 3056 | */ |
3112 | enum vxge_hw_status __vxge_hw_fifo_delete(struct __vxge_hw_vpath_handle *vp) | 3057 | static enum vxge_hw_status |
3058 | __vxge_hw_fifo_delete(struct __vxge_hw_vpath_handle *vp) | ||
3113 | { | 3059 | { |
3114 | struct __vxge_hw_fifo *fifo = vp->vpath->fifoh; | 3060 | struct __vxge_hw_fifo *fifo = vp->vpath->fifoh; |
3115 | 3061 | ||
@@ -4897,7 +4843,7 @@ static void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr, | |||
4897 | * __vxge_hw_blockpool_create - Create block pool | 4843 | * __vxge_hw_blockpool_create - Create block pool |
4898 | */ | 4844 | */ |
4899 | 4845 | ||
4900 | enum vxge_hw_status | 4846 | static enum vxge_hw_status |
4901 | __vxge_hw_blockpool_create(struct __vxge_hw_device *hldev, | 4847 | __vxge_hw_blockpool_create(struct __vxge_hw_device *hldev, |
4902 | struct __vxge_hw_blockpool *blockpool, | 4848 | struct __vxge_hw_blockpool *blockpool, |
4903 | u32 pool_size, | 4849 | u32 pool_size, |
@@ -4997,7 +4943,7 @@ blockpool_create_exit: | |||
4997 | * __vxge_hw_blockpool_destroy - Deallocates the block pool | 4943 | * __vxge_hw_blockpool_destroy - Deallocates the block pool |
4998 | */ | 4944 | */ |
4999 | 4945 | ||
5000 | void __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool) | 4946 | static void __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool) |
5001 | { | 4947 | { |
5002 | 4948 | ||
5003 | struct __vxge_hw_device *hldev; | 4949 | struct __vxge_hw_device *hldev; |
@@ -5163,7 +5109,7 @@ exit: | |||
5163 | * Allocates a block of memory of given size, either from block pool | 5109 | * Allocates a block of memory of given size, either from block pool |
5164 | * or by calling vxge_os_dma_malloc() | 5110 | * or by calling vxge_os_dma_malloc() |
5165 | */ | 5111 | */ |
5166 | void * | 5112 | static void * |
5167 | __vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size, | 5113 | __vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size, |
5168 | struct vxge_hw_mempool_dma *dma_object) | 5114 | struct vxge_hw_mempool_dma *dma_object) |
5169 | { | 5115 | { |
@@ -5227,7 +5173,7 @@ exit: | |||
5227 | * __vxge_hw_blockpool_free - Frees the memory allcoated with | 5173 | * __vxge_hw_blockpool_free - Frees the memory allcoated with |
5228 | __vxge_hw_blockpool_malloc | 5174 | __vxge_hw_blockpool_malloc |
5229 | */ | 5175 | */ |
5230 | void | 5176 | static void |
5231 | __vxge_hw_blockpool_free(struct __vxge_hw_device *devh, | 5177 | __vxge_hw_blockpool_free(struct __vxge_hw_device *devh, |
5232 | void *memblock, u32 size, | 5178 | void *memblock, u32 size, |
5233 | struct vxge_hw_mempool_dma *dma_object) | 5179 | struct vxge_hw_mempool_dma *dma_object) |
@@ -5279,7 +5225,7 @@ __vxge_hw_blockpool_free(struct __vxge_hw_device *devh, | |||
5279 | * __vxge_hw_blockpool_block_allocate - Allocates a block from block pool | 5225 | * __vxge_hw_blockpool_block_allocate - Allocates a block from block pool |
5280 | * This function allocates a block from block pool or from the system | 5226 | * This function allocates a block from block pool or from the system |
5281 | */ | 5227 | */ |
5282 | struct __vxge_hw_blockpool_entry * | 5228 | static struct __vxge_hw_blockpool_entry * |
5283 | __vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *devh, u32 size) | 5229 | __vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *devh, u32 size) |
5284 | { | 5230 | { |
5285 | struct __vxge_hw_blockpool_entry *entry = NULL; | 5231 | struct __vxge_hw_blockpool_entry *entry = NULL; |
@@ -5314,7 +5260,7 @@ __vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *devh, u32 size) | |||
5314 | * | 5260 | * |
5315 | * This function frees a block from block pool | 5261 | * This function frees a block from block pool |
5316 | */ | 5262 | */ |
5317 | void | 5263 | static void |
5318 | __vxge_hw_blockpool_block_free(struct __vxge_hw_device *devh, | 5264 | __vxge_hw_blockpool_block_free(struct __vxge_hw_device *devh, |
5319 | struct __vxge_hw_blockpool_entry *entry) | 5265 | struct __vxge_hw_blockpool_entry *entry) |
5320 | { | 5266 | { |