aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge/vxge-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/vxge/vxge-config.c')
-rw-r--r--drivers/net/vxge/vxge-config.c100
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
24static enum vxge_hw_status 24static 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
29static enum vxge_hw_status
30__vxge_hw_fifo_abort(
31 struct __vxge_hw_fifo *fifoh);
32
33static enum vxge_hw_status
34__vxge_hw_fifo_reset(
35 struct __vxge_hw_fifo *ringh);
36
37static 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
76static 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
81static void 62static 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
85static enum vxge_hw_status
86__vxge_hw_channel_initialize(
87 struct __vxge_hw_channel *channel);
88
89static enum vxge_hw_status
90__vxge_hw_channel_reset(
91 struct __vxge_hw_channel *channel);
92
93static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp); 66static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp);
94 67
95static enum vxge_hw_status 68static enum vxge_hw_status
96__vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config);
97
98static 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
101static void
102__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
103
104static enum vxge_hw_status
105__vxge_hw_device_initialize(struct __vxge_hw_device *hldev);
106
107static void
108__vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev);
109
110static enum vxge_hw_status
111__vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev);
112
113static enum vxge_hw_status 71static 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
131static struct vxge_hw_mempool* 89static 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
136static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool); 95static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool);
137 96
138static enum vxge_hw_status 97static enum vxge_hw_status
@@ -145,24 +104,10 @@ vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vpath_handle);
145static enum vxge_hw_status 104static 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
148static enum vxge_hw_status
149__vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
150
151
152static enum vxge_hw_status
153__vxge_hw_vpath_sw_reset(struct __vxge_hw_device *devh, u32 vp_id);
154
155static enum vxge_hw_status
156__vxge_hw_vpath_mac_configure(struct __vxge_hw_device *devh, u32 vp_id);
157
158static void 107static 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
161static enum vxge_hw_status 110static enum vxge_hw_status
162__vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath,
163 u32 operation, u32 offset, u64 *stat);
164
165static 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 */
508struct __vxge_hw_channel* 453static 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 */
579void __vxge_hw_channel_free(struct __vxge_hw_channel *channel) 524static 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 */
593enum vxge_hw_status 538static 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 */
628enum vxge_hw_status 573static 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 */
655void 600static 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 */
745enum vxge_hw_status 689static 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 */
941enum vxge_hw_status __vxge_hw_device_initialize(struct __vxge_hw_device *hldev) 885static 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 */
2340enum vxge_hw_status 2285static 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 */
2388enum vxge_hw_status 2333static 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 */
2948enum vxge_hw_status 2893static 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 */
3112enum vxge_hw_status __vxge_hw_fifo_delete(struct __vxge_hw_vpath_handle *vp) 3057static 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
4900enum vxge_hw_status 4846static 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
5000void __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool) 4946static 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 */
5166void * 5112static 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 */
5230void 5176static 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 */
5282struct __vxge_hw_blockpool_entry * 5228static 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 */
5317void 5263static 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{