diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-10-21 03:50:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-24 18:07:12 -0400 |
commit | 42821a5b393e36f5c0b267473d59d375578df7ec (patch) | |
tree | beeaa5a6ac9211567d9b13687585959a63ba1c8a | |
parent | 89ff05ec553f3e70b8773c501da01bf7ad952cab (diff) |
vxge: make functions local and remove dead code
Use results of make namespacecheck to make functions local and
remove code that is not used.
Also rename initialize_ethtool_ops to vxge_initialize_ethtool_ops.
Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/vxge/vxge-config.c | 332 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-config.h | 227 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-main.c | 64 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-main.h | 59 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-traffic.c | 101 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-traffic.h | 134 |
7 files changed, 304 insertions, 615 deletions
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c index 0e6db593560..906a3ca3676 100644 --- a/drivers/net/vxge/vxge-config.c +++ b/drivers/net/vxge/vxge-config.c | |||
@@ -20,6 +20,179 @@ | |||
20 | #include "vxge-traffic.h" | 20 | #include "vxge-traffic.h" |
21 | #include "vxge-config.h" | 21 | #include "vxge-config.h" |
22 | 22 | ||
23 | static enum vxge_hw_status | ||
24 | __vxge_hw_fifo_create( | ||
25 | struct __vxge_hw_vpath_handle *vpath_handle, | ||
26 | struct vxge_hw_fifo_attr *attr); | ||
27 | |||
28 | static enum vxge_hw_status | ||
29 | __vxge_hw_fifo_abort( | ||
30 | struct __vxge_hw_fifo *fifoh); | ||
31 | |||
32 | static enum vxge_hw_status | ||
33 | __vxge_hw_fifo_reset( | ||
34 | struct __vxge_hw_fifo *ringh); | ||
35 | |||
36 | static enum vxge_hw_status | ||
37 | __vxge_hw_fifo_delete( | ||
38 | struct __vxge_hw_vpath_handle *vpath_handle); | ||
39 | |||
40 | static struct __vxge_hw_blockpool_entry * | ||
41 | __vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *hldev, | ||
42 | u32 size); | ||
43 | |||
44 | static void | ||
45 | __vxge_hw_blockpool_block_free(struct __vxge_hw_device *hldev, | ||
46 | struct __vxge_hw_blockpool_entry *entry); | ||
47 | |||
48 | static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh, | ||
49 | void *block_addr, | ||
50 | u32 length, | ||
51 | struct pci_dev *dma_h, | ||
52 | struct pci_dev *acc_handle); | ||
53 | |||
54 | static enum vxge_hw_status | ||
55 | __vxge_hw_blockpool_create(struct __vxge_hw_device *hldev, | ||
56 | struct __vxge_hw_blockpool *blockpool, | ||
57 | u32 pool_size, | ||
58 | u32 pool_max); | ||
59 | |||
60 | static void | ||
61 | __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool); | ||
62 | |||
63 | static void * | ||
64 | __vxge_hw_blockpool_malloc(struct __vxge_hw_device *hldev, | ||
65 | u32 size, | ||
66 | struct vxge_hw_mempool_dma *dma_object); | ||
67 | |||
68 | static void | ||
69 | __vxge_hw_blockpool_free(struct __vxge_hw_device *hldev, | ||
70 | void *memblock, | ||
71 | u32 size, | ||
72 | struct vxge_hw_mempool_dma *dma_object); | ||
73 | |||
74 | |||
75 | static struct __vxge_hw_channel* | ||
76 | __vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph, | ||
77 | enum __vxge_hw_channel_type type, u32 length, | ||
78 | u32 per_dtr_space, void *userdata); | ||
79 | |||
80 | static void | ||
81 | __vxge_hw_channel_free( | ||
82 | struct __vxge_hw_channel *channel); | ||
83 | |||
84 | static enum vxge_hw_status | ||
85 | __vxge_hw_channel_initialize( | ||
86 | struct __vxge_hw_channel *channel); | ||
87 | |||
88 | static enum vxge_hw_status | ||
89 | __vxge_hw_channel_reset( | ||
90 | struct __vxge_hw_channel *channel); | ||
91 | |||
92 | static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp); | ||
93 | |||
94 | static enum vxge_hw_status | ||
95 | __vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config); | ||
96 | |||
97 | static enum vxge_hw_status | ||
98 | __vxge_hw_device_config_check(struct vxge_hw_device_config *new_config); | ||
99 | |||
100 | static void | ||
101 | __vxge_hw_device_id_get(struct __vxge_hw_device *hldev); | ||
102 | |||
103 | static void | ||
104 | __vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev); | ||
105 | |||
106 | static enum vxge_hw_status | ||
107 | __vxge_hw_vpath_card_info_get( | ||
108 | u32 vp_id, | ||
109 | struct vxge_hw_vpath_reg __iomem *vpath_reg, | ||
110 | struct vxge_hw_device_hw_info *hw_info); | ||
111 | |||
112 | static enum vxge_hw_status | ||
113 | __vxge_hw_device_initialize(struct __vxge_hw_device *hldev); | ||
114 | |||
115 | static void | ||
116 | __vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev); | ||
117 | |||
118 | static enum vxge_hw_status | ||
119 | __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev); | ||
120 | |||
121 | static enum vxge_hw_status | ||
122 | __vxge_hw_device_register_poll( | ||
123 | void __iomem *reg, | ||
124 | u64 mask, u32 max_millis); | ||
125 | |||
126 | static inline enum vxge_hw_status | ||
127 | __vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr, | ||
128 | u64 mask, u32 max_millis) | ||
129 | { | ||
130 | __vxge_hw_pio_mem_write32_lower((u32)vxge_bVALn(val64, 32, 32), addr); | ||
131 | wmb(); | ||
132 | |||
133 | __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32), addr); | ||
134 | wmb(); | ||
135 | |||
136 | return __vxge_hw_device_register_poll(addr, mask, max_millis); | ||
137 | } | ||
138 | |||
139 | static struct vxge_hw_mempool* | ||
140 | __vxge_hw_mempool_create(struct __vxge_hw_device *devh, u32 memblock_size, | ||
141 | u32 item_size, u32 private_size, u32 items_initial, | ||
142 | u32 items_max, struct vxge_hw_mempool_cbs *mp_callback, | ||
143 | void *userdata); | ||
144 | static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool); | ||
145 | |||
146 | static enum vxge_hw_status | ||
147 | __vxge_hw_vpath_stats_get(struct __vxge_hw_virtualpath *vpath, | ||
148 | struct vxge_hw_vpath_stats_hw_info *hw_stats); | ||
149 | |||
150 | static enum vxge_hw_status | ||
151 | vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vpath_handle); | ||
152 | |||
153 | static enum vxge_hw_status | ||
154 | __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg); | ||
155 | |||
156 | static u64 | ||
157 | __vxge_hw_vpath_pci_func_mode_get(u32 vp_id, | ||
158 | struct vxge_hw_vpath_reg __iomem *vpath_reg); | ||
159 | |||
160 | static u32 | ||
161 | __vxge_hw_vpath_func_id_get(u32 vp_id, struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg); | ||
162 | |||
163 | static enum vxge_hw_status | ||
164 | __vxge_hw_vpath_addr_get(u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg, | ||
165 | u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN]); | ||
166 | |||
167 | static enum vxge_hw_status | ||
168 | __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath); | ||
169 | |||
170 | |||
171 | static enum vxge_hw_status | ||
172 | __vxge_hw_vpath_sw_reset(struct __vxge_hw_device *devh, u32 vp_id); | ||
173 | |||
174 | static enum vxge_hw_status | ||
175 | __vxge_hw_vpath_fw_ver_get(u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg, | ||
176 | struct vxge_hw_device_hw_info *hw_info); | ||
177 | |||
178 | static enum vxge_hw_status | ||
179 | __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *devh, u32 vp_id); | ||
180 | |||
181 | static void | ||
182 | __vxge_hw_vp_terminate(struct __vxge_hw_device *devh, u32 vp_id); | ||
183 | |||
184 | static enum vxge_hw_status | ||
185 | __vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath, | ||
186 | u32 operation, u32 offset, u64 *stat); | ||
187 | |||
188 | static enum vxge_hw_status | ||
189 | __vxge_hw_vpath_xmac_tx_stats_get(struct __vxge_hw_virtualpath *vpath, | ||
190 | struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats); | ||
191 | |||
192 | static enum vxge_hw_status | ||
193 | __vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath *vpath, | ||
194 | struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats); | ||
195 | |||
23 | /* | 196 | /* |
24 | * __vxge_hw_channel_allocate - Allocate memory for channel | 197 | * __vxge_hw_channel_allocate - Allocate memory for channel |
25 | * This function allocates required memory for the channel and various arrays | 198 | * This function allocates required memory for the channel and various arrays |
@@ -190,7 +363,7 @@ __vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev) | |||
190 | * Will poll certain register for specified amount of time. | 363 | * Will poll certain register for specified amount of time. |
191 | * Will poll until masked bit is not cleared. | 364 | * Will poll until masked bit is not cleared. |
192 | */ | 365 | */ |
193 | enum vxge_hw_status | 366 | static enum vxge_hw_status |
194 | __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis) | 367 | __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis) |
195 | { | 368 | { |
196 | u64 val64; | 369 | u64 val64; |
@@ -221,7 +394,7 @@ __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis) | |||
221 | * in progress | 394 | * in progress |
222 | * This routine checks the vpath reset in progress register is turned zero | 395 | * This routine checks the vpath reset in progress register is turned zero |
223 | */ | 396 | */ |
224 | enum vxge_hw_status | 397 | static enum vxge_hw_status |
225 | __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog) | 398 | __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog) |
226 | { | 399 | { |
227 | enum vxge_hw_status status; | 400 | enum vxge_hw_status status; |
@@ -236,7 +409,7 @@ __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog) | |||
236 | * This routine sets the swapper and reads the toc pointer and returns the | 409 | * This routine sets the swapper and reads the toc pointer and returns the |
237 | * memory mapped address of the toc | 410 | * memory mapped address of the toc |
238 | */ | 411 | */ |
239 | struct vxge_hw_toc_reg __iomem * | 412 | static struct vxge_hw_toc_reg __iomem * |
240 | __vxge_hw_device_toc_get(void __iomem *bar0) | 413 | __vxge_hw_device_toc_get(void __iomem *bar0) |
241 | { | 414 | { |
242 | u64 val64; | 415 | u64 val64; |
@@ -779,7 +952,7 @@ exit: | |||
779 | * vxge_hw_device_xmac_aggr_stats_get - Get the Statistics on aggregate port | 952 | * vxge_hw_device_xmac_aggr_stats_get - Get the Statistics on aggregate port |
780 | * Get the Statistics on aggregate port | 953 | * Get the Statistics on aggregate port |
781 | */ | 954 | */ |
782 | enum vxge_hw_status | 955 | static enum vxge_hw_status |
783 | vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *hldev, u32 port, | 956 | vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *hldev, u32 port, |
784 | struct vxge_hw_xmac_aggr_stats *aggr_stats) | 957 | struct vxge_hw_xmac_aggr_stats *aggr_stats) |
785 | { | 958 | { |
@@ -814,7 +987,7 @@ exit: | |||
814 | * vxge_hw_device_xmac_port_stats_get - Get the Statistics on a port | 987 | * vxge_hw_device_xmac_port_stats_get - Get the Statistics on a port |
815 | * Get the Statistics on port | 988 | * Get the Statistics on port |
816 | */ | 989 | */ |
817 | enum vxge_hw_status | 990 | static enum vxge_hw_status |
818 | vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *hldev, u32 port, | 991 | vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *hldev, u32 port, |
819 | struct vxge_hw_xmac_port_stats *port_stats) | 992 | struct vxge_hw_xmac_port_stats *port_stats) |
820 | { | 993 | { |
@@ -952,20 +1125,6 @@ u32 vxge_hw_device_trace_level_get(struct __vxge_hw_device *hldev) | |||
952 | return 0; | 1125 | return 0; |
953 | #endif | 1126 | #endif |
954 | } | 1127 | } |
955 | /* | ||
956 | * vxge_hw_device_debug_mask_get - Get the debug mask | ||
957 | * This routine returns the current debug mask set | ||
958 | */ | ||
959 | u32 vxge_hw_device_debug_mask_get(struct __vxge_hw_device *hldev) | ||
960 | { | ||
961 | #if defined(VXGE_DEBUG_TRACE_MASK) || defined(VXGE_DEBUG_ERR_MASK) | ||
962 | if (hldev == NULL) | ||
963 | return 0; | ||
964 | return hldev->debug_module_mask; | ||
965 | #else | ||
966 | return 0; | ||
967 | #endif | ||
968 | } | ||
969 | 1128 | ||
970 | /* | 1129 | /* |
971 | * vxge_hw_getpause_data -Pause frame frame generation and reception. | 1130 | * vxge_hw_getpause_data -Pause frame frame generation and reception. |
@@ -1090,7 +1249,7 @@ __vxge_hw_ring_block_next_pointer_set(u8 *block, dma_addr_t dma_next) | |||
1090 | * first block | 1249 | * first block |
1091 | * Returns the dma address of the first RxD block | 1250 | * Returns the dma address of the first RxD block |
1092 | */ | 1251 | */ |
1093 | u64 __vxge_hw_ring_first_block_address_get(struct __vxge_hw_ring *ring) | 1252 | static u64 __vxge_hw_ring_first_block_address_get(struct __vxge_hw_ring *ring) |
1094 | { | 1253 | { |
1095 | struct vxge_hw_mempool_dma *dma_object; | 1254 | struct vxge_hw_mempool_dma *dma_object; |
1096 | 1255 | ||
@@ -1252,7 +1411,7 @@ exit: | |||
1252 | * This function creates Ring and initializes it. | 1411 | * This function creates Ring and initializes it. |
1253 | * | 1412 | * |
1254 | */ | 1413 | */ |
1255 | enum vxge_hw_status | 1414 | static enum vxge_hw_status |
1256 | __vxge_hw_ring_create(struct __vxge_hw_vpath_handle *vp, | 1415 | __vxge_hw_ring_create(struct __vxge_hw_vpath_handle *vp, |
1257 | struct vxge_hw_ring_attr *attr) | 1416 | struct vxge_hw_ring_attr *attr) |
1258 | { | 1417 | { |
@@ -1363,7 +1522,7 @@ exit: | |||
1363 | * __vxge_hw_ring_abort - Returns the RxD | 1522 | * __vxge_hw_ring_abort - Returns the RxD |
1364 | * This function terminates the RxDs of ring | 1523 | * This function terminates the RxDs of ring |
1365 | */ | 1524 | */ |
1366 | enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring) | 1525 | static enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring) |
1367 | { | 1526 | { |
1368 | void *rxdh; | 1527 | void *rxdh; |
1369 | struct __vxge_hw_channel *channel; | 1528 | struct __vxge_hw_channel *channel; |
@@ -1392,7 +1551,7 @@ enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring) | |||
1392 | * __vxge_hw_ring_reset - Resets the ring | 1551 | * __vxge_hw_ring_reset - Resets the ring |
1393 | * This function resets the ring during vpath reset operation | 1552 | * This function resets the ring during vpath reset operation |
1394 | */ | 1553 | */ |
1395 | enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring) | 1554 | static enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring) |
1396 | { | 1555 | { |
1397 | enum vxge_hw_status status = VXGE_HW_OK; | 1556 | enum vxge_hw_status status = VXGE_HW_OK; |
1398 | struct __vxge_hw_channel *channel; | 1557 | struct __vxge_hw_channel *channel; |
@@ -1419,7 +1578,7 @@ exit: | |||
1419 | * __vxge_hw_ring_delete - Removes the ring | 1578 | * __vxge_hw_ring_delete - Removes the ring |
1420 | * This function freeup the memory pool and removes the ring | 1579 | * This function freeup the memory pool and removes the ring |
1421 | */ | 1580 | */ |
1422 | enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp) | 1581 | static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp) |
1423 | { | 1582 | { |
1424 | struct __vxge_hw_ring *ring = vp->vpath->ringh; | 1583 | struct __vxge_hw_ring *ring = vp->vpath->ringh; |
1425 | 1584 | ||
@@ -1438,7 +1597,7 @@ enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp) | |||
1438 | * __vxge_hw_mempool_grow | 1597 | * __vxge_hw_mempool_grow |
1439 | * Will resize mempool up to %num_allocate value. | 1598 | * Will resize mempool up to %num_allocate value. |
1440 | */ | 1599 | */ |
1441 | enum vxge_hw_status | 1600 | static enum vxge_hw_status |
1442 | __vxge_hw_mempool_grow(struct vxge_hw_mempool *mempool, u32 num_allocate, | 1601 | __vxge_hw_mempool_grow(struct vxge_hw_mempool *mempool, u32 num_allocate, |
1443 | u32 *num_allocated) | 1602 | u32 *num_allocated) |
1444 | { | 1603 | { |
@@ -1527,7 +1686,7 @@ exit: | |||
1527 | * with size enough to hold %items_initial number of items. Memory is | 1686 | * with size enough to hold %items_initial number of items. Memory is |
1528 | * DMA-able but client must map/unmap before interoperating with the device. | 1687 | * DMA-able but client must map/unmap before interoperating with the device. |
1529 | */ | 1688 | */ |
1530 | struct vxge_hw_mempool* | 1689 | static struct vxge_hw_mempool* |
1531 | __vxge_hw_mempool_create( | 1690 | __vxge_hw_mempool_create( |
1532 | struct __vxge_hw_device *devh, | 1691 | struct __vxge_hw_device *devh, |
1533 | u32 memblock_size, | 1692 | u32 memblock_size, |
@@ -1644,7 +1803,7 @@ exit: | |||
1644 | /* | 1803 | /* |
1645 | * vxge_hw_mempool_destroy | 1804 | * vxge_hw_mempool_destroy |
1646 | */ | 1805 | */ |
1647 | void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool) | 1806 | static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool) |
1648 | { | 1807 | { |
1649 | u32 i, j; | 1808 | u32 i, j; |
1650 | struct __vxge_hw_device *devh = mempool->devh; | 1809 | struct __vxge_hw_device *devh = mempool->devh; |
@@ -1700,7 +1859,7 @@ __vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config) | |||
1700 | * __vxge_hw_device_vpath_config_check - Check vpath configuration. | 1859 | * __vxge_hw_device_vpath_config_check - Check vpath configuration. |
1701 | * Check the vpath configuration | 1860 | * Check the vpath configuration |
1702 | */ | 1861 | */ |
1703 | enum vxge_hw_status | 1862 | static enum vxge_hw_status |
1704 | __vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config) | 1863 | __vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config) |
1705 | { | 1864 | { |
1706 | enum vxge_hw_status status; | 1865 | enum vxge_hw_status status; |
@@ -1922,7 +2081,7 @@ vxge_hw_device_config_default_get(struct vxge_hw_device_config *device_config) | |||
1922 | * _hw_legacy_swapper_set - Set the swapper bits for the legacy secion. | 2081 | * _hw_legacy_swapper_set - Set the swapper bits for the legacy secion. |
1923 | * Set the swapper bits appropriately for the lagacy section. | 2082 | * Set the swapper bits appropriately for the lagacy section. |
1924 | */ | 2083 | */ |
1925 | enum vxge_hw_status | 2084 | static enum vxge_hw_status |
1926 | __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg) | 2085 | __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg) |
1927 | { | 2086 | { |
1928 | u64 val64; | 2087 | u64 val64; |
@@ -1977,7 +2136,7 @@ __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg) | |||
1977 | * __vxge_hw_vpath_swapper_set - Set the swapper bits for the vpath. | 2136 | * __vxge_hw_vpath_swapper_set - Set the swapper bits for the vpath. |
1978 | * Set the swapper bits appropriately for the vpath. | 2137 | * Set the swapper bits appropriately for the vpath. |
1979 | */ | 2138 | */ |
1980 | enum vxge_hw_status | 2139 | static enum vxge_hw_status |
1981 | __vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg) | 2140 | __vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg) |
1982 | { | 2141 | { |
1983 | #ifndef __BIG_ENDIAN | 2142 | #ifndef __BIG_ENDIAN |
@@ -1996,7 +2155,7 @@ __vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg) | |||
1996 | * __vxge_hw_kdfc_swapper_set - Set the swapper bits for the kdfc. | 2155 | * __vxge_hw_kdfc_swapper_set - Set the swapper bits for the kdfc. |
1997 | * Set the swapper bits appropriately for the vpath. | 2156 | * Set the swapper bits appropriately for the vpath. |
1998 | */ | 2157 | */ |
1999 | enum vxge_hw_status | 2158 | static enum vxge_hw_status |
2000 | __vxge_hw_kdfc_swapper_set( | 2159 | __vxge_hw_kdfc_swapper_set( |
2001 | struct vxge_hw_legacy_reg __iomem *legacy_reg, | 2160 | struct vxge_hw_legacy_reg __iomem *legacy_reg, |
2002 | struct vxge_hw_vpath_reg __iomem *vpath_reg) | 2161 | struct vxge_hw_vpath_reg __iomem *vpath_reg) |
@@ -2021,28 +2180,6 @@ __vxge_hw_kdfc_swapper_set( | |||
2021 | } | 2180 | } |
2022 | 2181 | ||
2023 | /* | 2182 | /* |
2024 | * vxge_hw_mgmt_device_config - Retrieve device configuration. | ||
2025 | * Get device configuration. Permits to retrieve at run-time configuration | ||
2026 | * values that were used to initialize and configure the device. | ||
2027 | */ | ||
2028 | enum vxge_hw_status | ||
2029 | vxge_hw_mgmt_device_config(struct __vxge_hw_device *hldev, | ||
2030 | struct vxge_hw_device_config *dev_config, int size) | ||
2031 | { | ||
2032 | |||
2033 | if ((hldev == NULL) || (hldev->magic != VXGE_HW_DEVICE_MAGIC)) | ||
2034 | return VXGE_HW_ERR_INVALID_DEVICE; | ||
2035 | |||
2036 | if (size != sizeof(struct vxge_hw_device_config)) | ||
2037 | return VXGE_HW_ERR_VERSION_CONFLICT; | ||
2038 | |||
2039 | memcpy(dev_config, &hldev->config, | ||
2040 | sizeof(struct vxge_hw_device_config)); | ||
2041 | |||
2042 | return VXGE_HW_OK; | ||
2043 | } | ||
2044 | |||
2045 | /* | ||
2046 | * vxge_hw_mgmt_reg_read - Read Titan register. | 2183 | * vxge_hw_mgmt_reg_read - Read Titan register. |
2047 | */ | 2184 | */ |
2048 | enum vxge_hw_status | 2185 | enum vxge_hw_status |
@@ -2438,7 +2575,7 @@ exit: | |||
2438 | * __vxge_hw_fifo_abort - Returns the TxD | 2575 | * __vxge_hw_fifo_abort - Returns the TxD |
2439 | * This function terminates the TxDs of fifo | 2576 | * This function terminates the TxDs of fifo |
2440 | */ | 2577 | */ |
2441 | enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo) | 2578 | static enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo) |
2442 | { | 2579 | { |
2443 | void *txdlh; | 2580 | void *txdlh; |
2444 | 2581 | ||
@@ -2466,7 +2603,7 @@ enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo) | |||
2466 | * __vxge_hw_fifo_reset - Resets the fifo | 2603 | * __vxge_hw_fifo_reset - Resets the fifo |
2467 | * This function resets the fifo during vpath reset operation | 2604 | * This function resets the fifo during vpath reset operation |
2468 | */ | 2605 | */ |
2469 | enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo) | 2606 | static enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo) |
2470 | { | 2607 | { |
2471 | enum vxge_hw_status status = VXGE_HW_OK; | 2608 | enum vxge_hw_status status = VXGE_HW_OK; |
2472 | 2609 | ||
@@ -2501,7 +2638,7 @@ enum vxge_hw_status __vxge_hw_fifo_delete(struct __vxge_hw_vpath_handle *vp) | |||
2501 | * in pci config space. | 2638 | * in pci config space. |
2502 | * Read from the vpath pci config space. | 2639 | * Read from the vpath pci config space. |
2503 | */ | 2640 | */ |
2504 | enum vxge_hw_status | 2641 | static enum vxge_hw_status |
2505 | __vxge_hw_vpath_pci_read(struct __vxge_hw_virtualpath *vpath, | 2642 | __vxge_hw_vpath_pci_read(struct __vxge_hw_virtualpath *vpath, |
2506 | u32 phy_func_0, u32 offset, u32 *val) | 2643 | u32 phy_func_0, u32 offset, u32 *val) |
2507 | { | 2644 | { |
@@ -2542,7 +2679,7 @@ exit: | |||
2542 | * __vxge_hw_vpath_func_id_get - Get the function id of the vpath. | 2679 | * __vxge_hw_vpath_func_id_get - Get the function id of the vpath. |
2543 | * Returns the function number of the vpath. | 2680 | * Returns the function number of the vpath. |
2544 | */ | 2681 | */ |
2545 | u32 | 2682 | static u32 |
2546 | __vxge_hw_vpath_func_id_get(u32 vp_id, | 2683 | __vxge_hw_vpath_func_id_get(u32 vp_id, |
2547 | struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg) | 2684 | struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg) |
2548 | { | 2685 | { |
@@ -2573,7 +2710,7 @@ __vxge_hw_read_rts_ds(struct vxge_hw_vpath_reg __iomem *vpath_reg, | |||
2573 | * __vxge_hw_vpath_card_info_get - Get the serial numbers, | 2710 | * __vxge_hw_vpath_card_info_get - Get the serial numbers, |
2574 | * part number and product description. | 2711 | * part number and product description. |
2575 | */ | 2712 | */ |
2576 | enum vxge_hw_status | 2713 | static enum vxge_hw_status |
2577 | __vxge_hw_vpath_card_info_get( | 2714 | __vxge_hw_vpath_card_info_get( |
2578 | u32 vp_id, | 2715 | u32 vp_id, |
2579 | struct vxge_hw_vpath_reg __iomem *vpath_reg, | 2716 | struct vxge_hw_vpath_reg __iomem *vpath_reg, |
@@ -2695,7 +2832,7 @@ __vxge_hw_vpath_card_info_get( | |||
2695 | * __vxge_hw_vpath_fw_ver_get - Get the fw version | 2832 | * __vxge_hw_vpath_fw_ver_get - Get the fw version |
2696 | * Returns FW Version | 2833 | * Returns FW Version |
2697 | */ | 2834 | */ |
2698 | enum vxge_hw_status | 2835 | static enum vxge_hw_status |
2699 | __vxge_hw_vpath_fw_ver_get( | 2836 | __vxge_hw_vpath_fw_ver_get( |
2700 | u32 vp_id, | 2837 | u32 vp_id, |
2701 | struct vxge_hw_vpath_reg __iomem *vpath_reg, | 2838 | struct vxge_hw_vpath_reg __iomem *vpath_reg, |
@@ -2789,7 +2926,7 @@ exit: | |||
2789 | * __vxge_hw_vpath_pci_func_mode_get - Get the pci mode | 2926 | * __vxge_hw_vpath_pci_func_mode_get - Get the pci mode |
2790 | * Returns pci function mode | 2927 | * Returns pci function mode |
2791 | */ | 2928 | */ |
2792 | u64 | 2929 | static u64 |
2793 | __vxge_hw_vpath_pci_func_mode_get( | 2930 | __vxge_hw_vpath_pci_func_mode_get( |
2794 | u32 vp_id, | 2931 | u32 vp_id, |
2795 | struct vxge_hw_vpath_reg __iomem *vpath_reg) | 2932 | struct vxge_hw_vpath_reg __iomem *vpath_reg) |
@@ -2995,7 +3132,7 @@ exit: | |||
2995 | * __vxge_hw_vpath_addr_get - Get the hw address entry for this vpath | 3132 | * __vxge_hw_vpath_addr_get - Get the hw address entry for this vpath |
2996 | * from MAC address table. | 3133 | * from MAC address table. |
2997 | */ | 3134 | */ |
2998 | enum vxge_hw_status | 3135 | static enum vxge_hw_status |
2999 | __vxge_hw_vpath_addr_get( | 3136 | __vxge_hw_vpath_addr_get( |
3000 | u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg, | 3137 | u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg, |
3001 | u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN]) | 3138 | u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN]) |
@@ -3347,7 +3484,7 @@ __vxge_hw_vpath_mgmt_read( | |||
3347 | * This routine checks the vpath_rst_in_prog register to see if | 3484 | * This routine checks the vpath_rst_in_prog register to see if |
3348 | * adapter completed the reset process for the vpath | 3485 | * adapter completed the reset process for the vpath |
3349 | */ | 3486 | */ |
3350 | enum vxge_hw_status | 3487 | static enum vxge_hw_status |
3351 | __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath) | 3488 | __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath) |
3352 | { | 3489 | { |
3353 | enum vxge_hw_status status; | 3490 | enum vxge_hw_status status; |
@@ -3365,7 +3502,7 @@ __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath) | |||
3365 | * __vxge_hw_vpath_reset | 3502 | * __vxge_hw_vpath_reset |
3366 | * This routine resets the vpath on the device | 3503 | * This routine resets the vpath on the device |
3367 | */ | 3504 | */ |
3368 | enum vxge_hw_status | 3505 | static enum vxge_hw_status |
3369 | __vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id) | 3506 | __vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id) |
3370 | { | 3507 | { |
3371 | u64 val64; | 3508 | u64 val64; |
@@ -3383,7 +3520,7 @@ __vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id) | |||
3383 | * __vxge_hw_vpath_sw_reset | 3520 | * __vxge_hw_vpath_sw_reset |
3384 | * This routine resets the vpath structures | 3521 | * This routine resets the vpath structures |
3385 | */ | 3522 | */ |
3386 | enum vxge_hw_status | 3523 | static enum vxge_hw_status |
3387 | __vxge_hw_vpath_sw_reset(struct __vxge_hw_device *hldev, u32 vp_id) | 3524 | __vxge_hw_vpath_sw_reset(struct __vxge_hw_device *hldev, u32 vp_id) |
3388 | { | 3525 | { |
3389 | enum vxge_hw_status status = VXGE_HW_OK; | 3526 | enum vxge_hw_status status = VXGE_HW_OK; |
@@ -3408,7 +3545,7 @@ exit: | |||
3408 | * This routine configures the prc registers of virtual path using the config | 3545 | * This routine configures the prc registers of virtual path using the config |
3409 | * passed | 3546 | * passed |
3410 | */ | 3547 | */ |
3411 | void | 3548 | static void |
3412 | __vxge_hw_vpath_prc_configure(struct __vxge_hw_device *hldev, u32 vp_id) | 3549 | __vxge_hw_vpath_prc_configure(struct __vxge_hw_device *hldev, u32 vp_id) |
3413 | { | 3550 | { |
3414 | u64 val64; | 3551 | u64 val64; |
@@ -3480,7 +3617,7 @@ __vxge_hw_vpath_prc_configure(struct __vxge_hw_device *hldev, u32 vp_id) | |||
3480 | * This routine configures the kdfc registers of virtual path using the | 3617 | * This routine configures the kdfc registers of virtual path using the |
3481 | * config passed | 3618 | * config passed |
3482 | */ | 3619 | */ |
3483 | enum vxge_hw_status | 3620 | static enum vxge_hw_status |
3484 | __vxge_hw_vpath_kdfc_configure(struct __vxge_hw_device *hldev, u32 vp_id) | 3621 | __vxge_hw_vpath_kdfc_configure(struct __vxge_hw_device *hldev, u32 vp_id) |
3485 | { | 3622 | { |
3486 | u64 val64; | 3623 | u64 val64; |
@@ -3553,7 +3690,7 @@ exit: | |||
3553 | * __vxge_hw_vpath_mac_configure | 3690 | * __vxge_hw_vpath_mac_configure |
3554 | * This routine configures the mac of virtual path using the config passed | 3691 | * This routine configures the mac of virtual path using the config passed |
3555 | */ | 3692 | */ |
3556 | enum vxge_hw_status | 3693 | static enum vxge_hw_status |
3557 | __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev, u32 vp_id) | 3694 | __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev, u32 vp_id) |
3558 | { | 3695 | { |
3559 | u64 val64; | 3696 | u64 val64; |
@@ -3621,7 +3758,7 @@ __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev, u32 vp_id) | |||
3621 | * This routine configures the tim registers of virtual path using the config | 3758 | * This routine configures the tim registers of virtual path using the config |
3622 | * passed | 3759 | * passed |
3623 | */ | 3760 | */ |
3624 | enum vxge_hw_status | 3761 | static enum vxge_hw_status |
3625 | __vxge_hw_vpath_tim_configure(struct __vxge_hw_device *hldev, u32 vp_id) | 3762 | __vxge_hw_vpath_tim_configure(struct __vxge_hw_device *hldev, u32 vp_id) |
3626 | { | 3763 | { |
3627 | u64 val64; | 3764 | u64 val64; |
@@ -3897,7 +4034,7 @@ vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id) | |||
3897 | * This routine is the final phase of init which initializes the | 4034 | * This routine is the final phase of init which initializes the |
3898 | * registers of the vpath using the configuration passed. | 4035 | * registers of the vpath using the configuration passed. |
3899 | */ | 4036 | */ |
3900 | enum vxge_hw_status | 4037 | static enum vxge_hw_status |
3901 | __vxge_hw_vpath_initialize(struct __vxge_hw_device *hldev, u32 vp_id) | 4038 | __vxge_hw_vpath_initialize(struct __vxge_hw_device *hldev, u32 vp_id) |
3902 | { | 4039 | { |
3903 | u64 val64; | 4040 | u64 val64; |
@@ -3966,7 +4103,7 @@ exit: | |||
3966 | * This routine is the initial phase of init which resets the vpath and | 4103 | * This routine is the initial phase of init which resets the vpath and |
3967 | * initializes the software support structures. | 4104 | * initializes the software support structures. |
3968 | */ | 4105 | */ |
3969 | enum vxge_hw_status | 4106 | static enum vxge_hw_status |
3970 | __vxge_hw_vp_initialize(struct __vxge_hw_device *hldev, u32 vp_id, | 4107 | __vxge_hw_vp_initialize(struct __vxge_hw_device *hldev, u32 vp_id, |
3971 | struct vxge_hw_vp_config *config) | 4108 | struct vxge_hw_vp_config *config) |
3972 | { | 4109 | { |
@@ -4022,7 +4159,7 @@ exit: | |||
4022 | * __vxge_hw_vp_terminate - Terminate Virtual Path structure | 4159 | * __vxge_hw_vp_terminate - Terminate Virtual Path structure |
4023 | * This routine closes all channels it opened and freeup memory | 4160 | * This routine closes all channels it opened and freeup memory |
4024 | */ | 4161 | */ |
4025 | void | 4162 | static void |
4026 | __vxge_hw_vp_terminate(struct __vxge_hw_device *hldev, u32 vp_id) | 4163 | __vxge_hw_vp_terminate(struct __vxge_hw_device *hldev, u32 vp_id) |
4027 | { | 4164 | { |
4028 | struct __vxge_hw_virtualpath *vpath; | 4165 | struct __vxge_hw_virtualpath *vpath; |
@@ -4384,7 +4521,7 @@ vxge_hw_vpath_enable(struct __vxge_hw_vpath_handle *vp) | |||
4384 | * Enable the DMA vpath statistics. The function is to be called to re-enable | 4521 | * Enable the DMA vpath statistics. The function is to be called to re-enable |
4385 | * the adapter to update stats into the host memory | 4522 | * the adapter to update stats into the host memory |
4386 | */ | 4523 | */ |
4387 | enum vxge_hw_status | 4524 | static enum vxge_hw_status |
4388 | vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vp) | 4525 | vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vp) |
4389 | { | 4526 | { |
4390 | enum vxge_hw_status status = VXGE_HW_OK; | 4527 | enum vxge_hw_status status = VXGE_HW_OK; |
@@ -4409,7 +4546,7 @@ exit: | |||
4409 | * __vxge_hw_vpath_stats_access - Get the statistics from the given location | 4546 | * __vxge_hw_vpath_stats_access - Get the statistics from the given location |
4410 | * and offset and perform an operation | 4547 | * and offset and perform an operation |
4411 | */ | 4548 | */ |
4412 | enum vxge_hw_status | 4549 | static enum vxge_hw_status |
4413 | __vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath, | 4550 | __vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath, |
4414 | u32 operation, u32 offset, u64 *stat) | 4551 | u32 operation, u32 offset, u64 *stat) |
4415 | { | 4552 | { |
@@ -4445,7 +4582,7 @@ vpath_stats_access_exit: | |||
4445 | /* | 4582 | /* |
4446 | * __vxge_hw_vpath_xmac_tx_stats_get - Get the TX Statistics of a vpath | 4583 | * __vxge_hw_vpath_xmac_tx_stats_get - Get the TX Statistics of a vpath |
4447 | */ | 4584 | */ |
4448 | enum vxge_hw_status | 4585 | static enum vxge_hw_status |
4449 | __vxge_hw_vpath_xmac_tx_stats_get( | 4586 | __vxge_hw_vpath_xmac_tx_stats_get( |
4450 | struct __vxge_hw_virtualpath *vpath, | 4587 | struct __vxge_hw_virtualpath *vpath, |
4451 | struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats) | 4588 | struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats) |
@@ -4478,9 +4615,9 @@ exit: | |||
4478 | /* | 4615 | /* |
4479 | * __vxge_hw_vpath_xmac_rx_stats_get - Get the RX Statistics of a vpath | 4616 | * __vxge_hw_vpath_xmac_rx_stats_get - Get the RX Statistics of a vpath |
4480 | */ | 4617 | */ |
4481 | enum vxge_hw_status | 4618 | static enum vxge_hw_status |
4482 | __vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath *vpath, | 4619 | __vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath *vpath, |
4483 | struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats) | 4620 | struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats) |
4484 | { | 4621 | { |
4485 | u64 *val64; | 4622 | u64 *val64; |
4486 | enum vxge_hw_status status = VXGE_HW_OK; | 4623 | enum vxge_hw_status status = VXGE_HW_OK; |
@@ -4509,9 +4646,9 @@ exit: | |||
4509 | /* | 4646 | /* |
4510 | * __vxge_hw_vpath_stats_get - Get the vpath hw statistics. | 4647 | * __vxge_hw_vpath_stats_get - Get the vpath hw statistics. |
4511 | */ | 4648 | */ |
4512 | enum vxge_hw_status __vxge_hw_vpath_stats_get( | 4649 | static enum vxge_hw_status |
4513 | struct __vxge_hw_virtualpath *vpath, | 4650 | __vxge_hw_vpath_stats_get(struct __vxge_hw_virtualpath *vpath, |
4514 | struct vxge_hw_vpath_stats_hw_info *hw_stats) | 4651 | struct vxge_hw_vpath_stats_hw_info *hw_stats) |
4515 | { | 4652 | { |
4516 | u64 val64; | 4653 | u64 val64; |
4517 | enum vxge_hw_status status = VXGE_HW_OK; | 4654 | enum vxge_hw_status status = VXGE_HW_OK; |
@@ -4643,6 +4780,32 @@ exit: | |||
4643 | return status; | 4780 | return status; |
4644 | } | 4781 | } |
4645 | 4782 | ||
4783 | |||
4784 | static void vxge_os_dma_malloc_async(struct pci_dev *pdev, void *devh, | ||
4785 | unsigned long size) | ||
4786 | { | ||
4787 | gfp_t flags; | ||
4788 | void *vaddr; | ||
4789 | |||
4790 | if (in_interrupt()) | ||
4791 | flags = GFP_ATOMIC | GFP_DMA; | ||
4792 | else | ||
4793 | flags = GFP_KERNEL | GFP_DMA; | ||
4794 | |||
4795 | vaddr = kmalloc((size), flags); | ||
4796 | |||
4797 | vxge_hw_blockpool_block_add(devh, vaddr, size, pdev, pdev); | ||
4798 | } | ||
4799 | |||
4800 | static void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr, | ||
4801 | struct pci_dev **p_dma_acch) | ||
4802 | { | ||
4803 | unsigned long misaligned = *(unsigned long *)p_dma_acch; | ||
4804 | u8 *tmp = (u8 *)vaddr; | ||
4805 | tmp -= misaligned; | ||
4806 | kfree((void *)tmp); | ||
4807 | } | ||
4808 | |||
4646 | /* | 4809 | /* |
4647 | * __vxge_hw_blockpool_create - Create block pool | 4810 | * __vxge_hw_blockpool_create - Create block pool |
4648 | */ | 4811 | */ |
@@ -4845,12 +5008,11 @@ void __vxge_hw_blockpool_blocks_remove(struct __vxge_hw_blockpool *blockpool) | |||
4845 | * vxge_hw_blockpool_block_add - callback for vxge_os_dma_malloc_async | 5008 | * vxge_hw_blockpool_block_add - callback for vxge_os_dma_malloc_async |
4846 | * Adds a block to block pool | 5009 | * Adds a block to block pool |
4847 | */ | 5010 | */ |
4848 | void vxge_hw_blockpool_block_add( | 5011 | static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh, |
4849 | struct __vxge_hw_device *devh, | 5012 | void *block_addr, |
4850 | void *block_addr, | 5013 | u32 length, |
4851 | u32 length, | 5014 | struct pci_dev *dma_h, |
4852 | struct pci_dev *dma_h, | 5015 | struct pci_dev *acc_handle) |
4853 | struct pci_dev *acc_handle) | ||
4854 | { | 5016 | { |
4855 | struct __vxge_hw_blockpool *blockpool; | 5017 | struct __vxge_hw_blockpool *blockpool; |
4856 | struct __vxge_hw_blockpool_entry *entry = NULL; | 5018 | struct __vxge_hw_blockpool_entry *entry = NULL; |
diff --git a/drivers/net/vxge/vxge-config.h b/drivers/net/vxge/vxge-config.h index 1a94343023c..5c00861b6c2 100644 --- a/drivers/net/vxge/vxge-config.h +++ b/drivers/net/vxge/vxge-config.h | |||
@@ -183,11 +183,6 @@ struct vxge_hw_device_version { | |||
183 | char version[VXGE_HW_FW_STRLEN]; | 183 | char version[VXGE_HW_FW_STRLEN]; |
184 | }; | 184 | }; |
185 | 185 | ||
186 | u64 | ||
187 | __vxge_hw_vpath_pci_func_mode_get( | ||
188 | u32 vp_id, | ||
189 | struct vxge_hw_vpath_reg __iomem *vpath_reg); | ||
190 | |||
191 | /** | 186 | /** |
192 | * struct vxge_hw_fifo_config - Configuration of fifo. | 187 | * struct vxge_hw_fifo_config - Configuration of fifo. |
193 | * @enable: Is this fifo to be commissioned | 188 | * @enable: Is this fifo to be commissioned |
@@ -1426,9 +1421,6 @@ struct vxge_hw_rth_hash_types { | |||
1426 | u8 hash_type_ipv6ex_en; | 1421 | u8 hash_type_ipv6ex_en; |
1427 | }; | 1422 | }; |
1428 | 1423 | ||
1429 | u32 | ||
1430 | vxge_hw_device_debug_mask_get(struct __vxge_hw_device *devh); | ||
1431 | |||
1432 | void vxge_hw_device_debug_set( | 1424 | void vxge_hw_device_debug_set( |
1433 | struct __vxge_hw_device *devh, | 1425 | struct __vxge_hw_device *devh, |
1434 | enum vxge_debug_level level, | 1426 | enum vxge_debug_level level, |
@@ -1440,9 +1432,6 @@ vxge_hw_device_error_level_get(struct __vxge_hw_device *devh); | |||
1440 | u32 | 1432 | u32 |
1441 | vxge_hw_device_trace_level_get(struct __vxge_hw_device *devh); | 1433 | vxge_hw_device_trace_level_get(struct __vxge_hw_device *devh); |
1442 | 1434 | ||
1443 | u32 | ||
1444 | vxge_hw_device_debug_mask_get(struct __vxge_hw_device *devh); | ||
1445 | |||
1446 | /** | 1435 | /** |
1447 | * vxge_hw_ring_rxd_size_get - Get the size of ring descriptor. | 1436 | * vxge_hw_ring_rxd_size_get - Get the size of ring descriptor. |
1448 | * @buf_mode: Buffer mode (1, 3 or 5) | 1437 | * @buf_mode: Buffer mode (1, 3 or 5) |
@@ -1817,60 +1806,10 @@ struct vxge_hw_vpath_attr { | |||
1817 | struct vxge_hw_fifo_attr fifo_attr; | 1806 | struct vxge_hw_fifo_attr fifo_attr; |
1818 | }; | 1807 | }; |
1819 | 1808 | ||
1820 | enum vxge_hw_status | ||
1821 | __vxge_hw_blockpool_create(struct __vxge_hw_device *hldev, | ||
1822 | struct __vxge_hw_blockpool *blockpool, | ||
1823 | u32 pool_size, | ||
1824 | u32 pool_max); | ||
1825 | |||
1826 | void | ||
1827 | __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool); | ||
1828 | |||
1829 | struct __vxge_hw_blockpool_entry * | ||
1830 | __vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *hldev, | ||
1831 | u32 size); | ||
1832 | |||
1833 | void | ||
1834 | __vxge_hw_blockpool_block_free(struct __vxge_hw_device *hldev, | ||
1835 | struct __vxge_hw_blockpool_entry *entry); | ||
1836 | |||
1837 | void * | ||
1838 | __vxge_hw_blockpool_malloc(struct __vxge_hw_device *hldev, | ||
1839 | u32 size, | ||
1840 | struct vxge_hw_mempool_dma *dma_object); | ||
1841 | |||
1842 | void | ||
1843 | __vxge_hw_blockpool_free(struct __vxge_hw_device *hldev, | ||
1844 | void *memblock, | ||
1845 | u32 size, | ||
1846 | struct vxge_hw_mempool_dma *dma_object); | ||
1847 | |||
1848 | enum vxge_hw_status | ||
1849 | __vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config); | ||
1850 | |||
1851 | enum vxge_hw_status | ||
1852 | __vxge_hw_device_config_check(struct vxge_hw_device_config *new_config); | ||
1853 | |||
1854 | enum vxge_hw_status | ||
1855 | vxge_hw_mgmt_device_config(struct __vxge_hw_device *devh, | ||
1856 | struct vxge_hw_device_config *dev_config, int size); | ||
1857 | |||
1858 | enum vxge_hw_status __devinit vxge_hw_device_hw_info_get( | 1809 | enum vxge_hw_status __devinit vxge_hw_device_hw_info_get( |
1859 | void __iomem *bar0, | 1810 | void __iomem *bar0, |
1860 | struct vxge_hw_device_hw_info *hw_info); | 1811 | struct vxge_hw_device_hw_info *hw_info); |
1861 | 1812 | ||
1862 | enum vxge_hw_status | ||
1863 | __vxge_hw_vpath_fw_ver_get( | ||
1864 | u32 vp_id, | ||
1865 | struct vxge_hw_vpath_reg __iomem *vpath_reg, | ||
1866 | struct vxge_hw_device_hw_info *hw_info); | ||
1867 | |||
1868 | enum vxge_hw_status | ||
1869 | __vxge_hw_vpath_card_info_get( | ||
1870 | u32 vp_id, | ||
1871 | struct vxge_hw_vpath_reg __iomem *vpath_reg, | ||
1872 | struct vxge_hw_device_hw_info *hw_info); | ||
1873 | |||
1874 | enum vxge_hw_status __devinit vxge_hw_device_config_default_get( | 1813 | enum vxge_hw_status __devinit vxge_hw_device_config_default_get( |
1875 | struct vxge_hw_device_config *device_config); | 1814 | struct vxge_hw_device_config *device_config); |
1876 | 1815 | ||
@@ -1954,38 +1893,6 @@ out: | |||
1954 | return vaddr; | 1893 | return vaddr; |
1955 | } | 1894 | } |
1956 | 1895 | ||
1957 | extern void vxge_hw_blockpool_block_add( | ||
1958 | struct __vxge_hw_device *devh, | ||
1959 | void *block_addr, | ||
1960 | u32 length, | ||
1961 | struct pci_dev *dma_h, | ||
1962 | struct pci_dev *acc_handle); | ||
1963 | |||
1964 | static inline void vxge_os_dma_malloc_async(struct pci_dev *pdev, void *devh, | ||
1965 | unsigned long size) | ||
1966 | { | ||
1967 | gfp_t flags; | ||
1968 | void *vaddr; | ||
1969 | |||
1970 | if (in_interrupt()) | ||
1971 | flags = GFP_ATOMIC | GFP_DMA; | ||
1972 | else | ||
1973 | flags = GFP_KERNEL | GFP_DMA; | ||
1974 | |||
1975 | vaddr = kmalloc((size), flags); | ||
1976 | |||
1977 | vxge_hw_blockpool_block_add(devh, vaddr, size, pdev, pdev); | ||
1978 | } | ||
1979 | |||
1980 | static inline void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr, | ||
1981 | struct pci_dev **p_dma_acch) | ||
1982 | { | ||
1983 | unsigned long misaligned = *(unsigned long *)p_dma_acch; | ||
1984 | u8 *tmp = (u8 *)vaddr; | ||
1985 | tmp -= misaligned; | ||
1986 | kfree((void *)tmp); | ||
1987 | } | ||
1988 | |||
1989 | /* | 1896 | /* |
1990 | * __vxge_hw_mempool_item_priv - will return pointer on per item private space | 1897 | * __vxge_hw_mempool_item_priv - will return pointer on per item private space |
1991 | */ | 1898 | */ |
@@ -2010,40 +1917,6 @@ __vxge_hw_mempool_item_priv( | |||
2010 | (*memblock_item_idx) * mempool->items_priv_size; | 1917 | (*memblock_item_idx) * mempool->items_priv_size; |
2011 | } | 1918 | } |
2012 | 1919 | ||
2013 | enum vxge_hw_status | ||
2014 | __vxge_hw_mempool_grow( | ||
2015 | struct vxge_hw_mempool *mempool, | ||
2016 | u32 num_allocate, | ||
2017 | u32 *num_allocated); | ||
2018 | |||
2019 | struct vxge_hw_mempool* | ||
2020 | __vxge_hw_mempool_create( | ||
2021 | struct __vxge_hw_device *devh, | ||
2022 | u32 memblock_size, | ||
2023 | u32 item_size, | ||
2024 | u32 private_size, | ||
2025 | u32 items_initial, | ||
2026 | u32 items_max, | ||
2027 | struct vxge_hw_mempool_cbs *mp_callback, | ||
2028 | void *userdata); | ||
2029 | |||
2030 | struct __vxge_hw_channel* | ||
2031 | __vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph, | ||
2032 | enum __vxge_hw_channel_type type, u32 length, | ||
2033 | u32 per_dtr_space, void *userdata); | ||
2034 | |||
2035 | void | ||
2036 | __vxge_hw_channel_free( | ||
2037 | struct __vxge_hw_channel *channel); | ||
2038 | |||
2039 | enum vxge_hw_status | ||
2040 | __vxge_hw_channel_initialize( | ||
2041 | struct __vxge_hw_channel *channel); | ||
2042 | |||
2043 | enum vxge_hw_status | ||
2044 | __vxge_hw_channel_reset( | ||
2045 | struct __vxge_hw_channel *channel); | ||
2046 | |||
2047 | /* | 1920 | /* |
2048 | * __vxge_hw_fifo_txdl_priv - Return the max fragments allocated | 1921 | * __vxge_hw_fifo_txdl_priv - Return the max fragments allocated |
2049 | * for the fifo. | 1922 | * for the fifo. |
@@ -2065,9 +1938,6 @@ enum vxge_hw_status vxge_hw_vpath_open( | |||
2065 | struct vxge_hw_vpath_attr *attr, | 1938 | struct vxge_hw_vpath_attr *attr, |
2066 | struct __vxge_hw_vpath_handle **vpath_handle); | 1939 | struct __vxge_hw_vpath_handle **vpath_handle); |
2067 | 1940 | ||
2068 | enum vxge_hw_status | ||
2069 | __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog); | ||
2070 | |||
2071 | enum vxge_hw_status vxge_hw_vpath_close( | 1941 | enum vxge_hw_status vxge_hw_vpath_close( |
2072 | struct __vxge_hw_vpath_handle *vpath_handle); | 1942 | struct __vxge_hw_vpath_handle *vpath_handle); |
2073 | 1943 | ||
@@ -2089,54 +1959,9 @@ enum vxge_hw_status vxge_hw_vpath_mtu_set( | |||
2089 | struct __vxge_hw_vpath_handle *vpath_handle, | 1959 | struct __vxge_hw_vpath_handle *vpath_handle, |
2090 | u32 new_mtu); | 1960 | u32 new_mtu); |
2091 | 1961 | ||
2092 | enum vxge_hw_status vxge_hw_vpath_stats_enable( | ||
2093 | struct __vxge_hw_vpath_handle *vpath_handle); | ||
2094 | |||
2095 | enum vxge_hw_status | ||
2096 | __vxge_hw_vpath_stats_access( | ||
2097 | struct __vxge_hw_virtualpath *vpath, | ||
2098 | u32 operation, | ||
2099 | u32 offset, | ||
2100 | u64 *stat); | ||
2101 | |||
2102 | enum vxge_hw_status | ||
2103 | __vxge_hw_vpath_xmac_tx_stats_get( | ||
2104 | struct __vxge_hw_virtualpath *vpath, | ||
2105 | struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats); | ||
2106 | |||
2107 | enum vxge_hw_status | ||
2108 | __vxge_hw_vpath_xmac_rx_stats_get( | ||
2109 | struct __vxge_hw_virtualpath *vpath, | ||
2110 | struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats); | ||
2111 | |||
2112 | enum vxge_hw_status | ||
2113 | __vxge_hw_vpath_stats_get( | ||
2114 | struct __vxge_hw_virtualpath *vpath, | ||
2115 | struct vxge_hw_vpath_stats_hw_info *hw_stats); | ||
2116 | |||
2117 | void | 1962 | void |
2118 | vxge_hw_vpath_rx_doorbell_init(struct __vxge_hw_vpath_handle *vp); | 1963 | vxge_hw_vpath_rx_doorbell_init(struct __vxge_hw_vpath_handle *vp); |
2119 | 1964 | ||
2120 | enum vxge_hw_status | ||
2121 | __vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config); | ||
2122 | |||
2123 | void | ||
2124 | __vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev); | ||
2125 | |||
2126 | enum vxge_hw_status | ||
2127 | __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg); | ||
2128 | |||
2129 | enum vxge_hw_status | ||
2130 | __vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg); | ||
2131 | |||
2132 | enum vxge_hw_status | ||
2133 | __vxge_hw_kdfc_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg, | ||
2134 | struct vxge_hw_vpath_reg __iomem *vpath_reg); | ||
2135 | |||
2136 | enum vxge_hw_status | ||
2137 | __vxge_hw_device_register_poll( | ||
2138 | void __iomem *reg, | ||
2139 | u64 mask, u32 max_millis); | ||
2140 | 1965 | ||
2141 | #ifndef readq | 1966 | #ifndef readq |
2142 | static inline u64 readq(void __iomem *addr) | 1967 | static inline u64 readq(void __iomem *addr) |
@@ -2168,62 +1993,12 @@ static inline void __vxge_hw_pio_mem_write32_lower(u32 val, void __iomem *addr) | |||
2168 | writel(val, addr); | 1993 | writel(val, addr); |
2169 | } | 1994 | } |
2170 | 1995 | ||
2171 | static inline enum vxge_hw_status | ||
2172 | __vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr, | ||
2173 | u64 mask, u32 max_millis) | ||
2174 | { | ||
2175 | enum vxge_hw_status status = VXGE_HW_OK; | ||
2176 | |||
2177 | __vxge_hw_pio_mem_write32_lower((u32)vxge_bVALn(val64, 32, 32), addr); | ||
2178 | wmb(); | ||
2179 | __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32), addr); | ||
2180 | wmb(); | ||
2181 | |||
2182 | status = __vxge_hw_device_register_poll(addr, mask, max_millis); | ||
2183 | return status; | ||
2184 | } | ||
2185 | |||
2186 | struct vxge_hw_toc_reg __iomem * | ||
2187 | __vxge_hw_device_toc_get(void __iomem *bar0); | ||
2188 | |||
2189 | enum vxge_hw_status | ||
2190 | __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev); | ||
2191 | |||
2192 | void | ||
2193 | __vxge_hw_device_id_get(struct __vxge_hw_device *hldev); | ||
2194 | |||
2195 | void | ||
2196 | __vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev); | ||
2197 | |||
2198 | enum vxge_hw_status | 1996 | enum vxge_hw_status |
2199 | vxge_hw_device_flick_link_led(struct __vxge_hw_device *devh, u64 on_off); | 1997 | vxge_hw_device_flick_link_led(struct __vxge_hw_device *devh, u64 on_off); |
2200 | 1998 | ||
2201 | enum vxge_hw_status | 1999 | enum vxge_hw_status |
2202 | __vxge_hw_device_initialize(struct __vxge_hw_device *hldev); | ||
2203 | |||
2204 | enum vxge_hw_status | ||
2205 | __vxge_hw_vpath_pci_read( | ||
2206 | struct __vxge_hw_virtualpath *vpath, | ||
2207 | u32 phy_func_0, | ||
2208 | u32 offset, | ||
2209 | u32 *val); | ||
2210 | |||
2211 | enum vxge_hw_status | ||
2212 | __vxge_hw_vpath_addr_get( | ||
2213 | u32 vp_id, | ||
2214 | struct vxge_hw_vpath_reg __iomem *vpath_reg, | ||
2215 | u8 (macaddr)[ETH_ALEN], | ||
2216 | u8 (macaddr_mask)[ETH_ALEN]); | ||
2217 | |||
2218 | u32 | ||
2219 | __vxge_hw_vpath_func_id_get( | ||
2220 | u32 vp_id, struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg); | ||
2221 | |||
2222 | enum vxge_hw_status | ||
2223 | __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath); | ||
2224 | |||
2225 | enum vxge_hw_status | ||
2226 | vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask); | 2000 | vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask); |
2001 | |||
2227 | /** | 2002 | /** |
2228 | * vxge_debug | 2003 | * vxge_debug |
2229 | * @level: level of debug verbosity. | 2004 | * @level: level of debug verbosity. |
diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c index 05679e306fd..b67746eef92 100644 --- a/drivers/net/vxge/vxge-ethtool.c +++ b/drivers/net/vxge/vxge-ethtool.c | |||
@@ -1142,7 +1142,7 @@ static const struct ethtool_ops vxge_ethtool_ops = { | |||
1142 | .get_ethtool_stats = vxge_get_ethtool_stats, | 1142 | .get_ethtool_stats = vxge_get_ethtool_stats, |
1143 | }; | 1143 | }; |
1144 | 1144 | ||
1145 | void initialize_ethtool_ops(struct net_device *ndev) | 1145 | void vxge_initialize_ethtool_ops(struct net_device *ndev) |
1146 | { | 1146 | { |
1147 | SET_ETHTOOL_OPS(ndev, &vxge_ethtool_ops); | 1147 | SET_ETHTOOL_OPS(ndev, &vxge_ethtool_ops); |
1148 | } | 1148 | } |
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index a69542ecb68..813829f3d02 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -82,6 +82,16 @@ module_param_array(bw_percentage, uint, NULL, 0); | |||
82 | 82 | ||
83 | static struct vxge_drv_config *driver_config; | 83 | static struct vxge_drv_config *driver_config; |
84 | 84 | ||
85 | static enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, | ||
86 | struct macInfo *mac); | ||
87 | static enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev, | ||
88 | struct macInfo *mac); | ||
89 | static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac); | ||
90 | static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac); | ||
91 | static enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath); | ||
92 | static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath); | ||
93 | static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev); | ||
94 | |||
85 | static inline int is_vxge_card_up(struct vxgedev *vdev) | 95 | static inline int is_vxge_card_up(struct vxgedev *vdev) |
86 | { | 96 | { |
87 | return test_bit(__VXGE_STATE_CARD_UP, &vdev->state); | 97 | return test_bit(__VXGE_STATE_CARD_UP, &vdev->state); |
@@ -138,7 +148,7 @@ static inline void VXGE_COMPLETE_ALL_RX(struct vxgedev *vdev) | |||
138 | * This function is called during interrupt context to notify link up state | 148 | * This function is called during interrupt context to notify link up state |
139 | * change. | 149 | * change. |
140 | */ | 150 | */ |
141 | void | 151 | static void |
142 | vxge_callback_link_up(struct __vxge_hw_device *hldev) | 152 | vxge_callback_link_up(struct __vxge_hw_device *hldev) |
143 | { | 153 | { |
144 | struct net_device *dev = hldev->ndev; | 154 | struct net_device *dev = hldev->ndev; |
@@ -162,7 +172,7 @@ vxge_callback_link_up(struct __vxge_hw_device *hldev) | |||
162 | * This function is called during interrupt context to notify link down state | 172 | * This function is called during interrupt context to notify link down state |
163 | * change. | 173 | * change. |
164 | */ | 174 | */ |
165 | void | 175 | static void |
166 | vxge_callback_link_down(struct __vxge_hw_device *hldev) | 176 | vxge_callback_link_down(struct __vxge_hw_device *hldev) |
167 | { | 177 | { |
168 | struct net_device *dev = hldev->ndev; | 178 | struct net_device *dev = hldev->ndev; |
@@ -354,7 +364,7 @@ static inline void vxge_post(int *dtr_cnt, void **first_dtr, | |||
354 | * If the interrupt is because of a received frame or if the receive ring | 364 | * If the interrupt is because of a received frame or if the receive ring |
355 | * contains fresh as yet un-processed frames, this function is called. | 365 | * contains fresh as yet un-processed frames, this function is called. |
356 | */ | 366 | */ |
357 | enum vxge_hw_status | 367 | static enum vxge_hw_status |
358 | vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr, | 368 | vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr, |
359 | u8 t_code, void *userdata) | 369 | u8 t_code, void *userdata) |
360 | { | 370 | { |
@@ -531,7 +541,7 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr, | |||
531 | * freed and frees all skbs whose data have already DMA'ed into the NICs | 541 | * freed and frees all skbs whose data have already DMA'ed into the NICs |
532 | * internal memory. | 542 | * internal memory. |
533 | */ | 543 | */ |
534 | enum vxge_hw_status | 544 | static enum vxge_hw_status |
535 | vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, | 545 | vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, |
536 | enum vxge_hw_fifo_tcode t_code, void *userdata, | 546 | enum vxge_hw_fifo_tcode t_code, void *userdata, |
537 | struct sk_buff ***skb_ptr, int nr_skb, int *more) | 547 | struct sk_buff ***skb_ptr, int nr_skb, int *more) |
@@ -1246,7 +1256,7 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p) | |||
1246 | * | 1256 | * |
1247 | * Enables the interrupts for the vpath | 1257 | * Enables the interrupts for the vpath |
1248 | */ | 1258 | */ |
1249 | void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id) | 1259 | static void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id) |
1250 | { | 1260 | { |
1251 | struct vxge_vpath *vpath = &vdev->vpaths[vp_id]; | 1261 | struct vxge_vpath *vpath = &vdev->vpaths[vp_id]; |
1252 | int msix_id = 0; | 1262 | int msix_id = 0; |
@@ -1279,7 +1289,7 @@ void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id) | |||
1279 | * | 1289 | * |
1280 | * Disables the interrupts for the vpath | 1290 | * Disables the interrupts for the vpath |
1281 | */ | 1291 | */ |
1282 | void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id) | 1292 | static void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id) |
1283 | { | 1293 | { |
1284 | struct vxge_vpath *vpath = &vdev->vpaths[vp_id]; | 1294 | struct vxge_vpath *vpath = &vdev->vpaths[vp_id]; |
1285 | int msix_id; | 1295 | int msix_id; |
@@ -1553,7 +1563,7 @@ out: | |||
1553 | * | 1563 | * |
1554 | * driver may reset the chip on events of serr, eccerr, etc | 1564 | * driver may reset the chip on events of serr, eccerr, etc |
1555 | */ | 1565 | */ |
1556 | int vxge_reset(struct vxgedev *vdev) | 1566 | static int vxge_reset(struct vxgedev *vdev) |
1557 | { | 1567 | { |
1558 | return do_vxge_reset(vdev, VXGE_LL_FULL_RESET); | 1568 | return do_vxge_reset(vdev, VXGE_LL_FULL_RESET); |
1559 | } | 1569 | } |
@@ -1724,7 +1734,7 @@ static enum vxge_hw_status vxge_rth_configure(struct vxgedev *vdev) | |||
1724 | return status; | 1734 | return status; |
1725 | } | 1735 | } |
1726 | 1736 | ||
1727 | int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac) | 1737 | static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac) |
1728 | { | 1738 | { |
1729 | struct vxge_mac_addrs *new_mac_entry; | 1739 | struct vxge_mac_addrs *new_mac_entry; |
1730 | u8 *mac_address = NULL; | 1740 | u8 *mac_address = NULL; |
@@ -1757,7 +1767,8 @@ int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac) | |||
1757 | } | 1767 | } |
1758 | 1768 | ||
1759 | /* Add a mac address to DA table */ | 1769 | /* Add a mac address to DA table */ |
1760 | enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, struct macInfo *mac) | 1770 | static enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, |
1771 | struct macInfo *mac) | ||
1761 | { | 1772 | { |
1762 | enum vxge_hw_status status = VXGE_HW_OK; | 1773 | enum vxge_hw_status status = VXGE_HW_OK; |
1763 | struct vxge_vpath *vpath; | 1774 | struct vxge_vpath *vpath; |
@@ -1782,7 +1793,7 @@ enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, struct macInfo *mac) | |||
1782 | return status; | 1793 | return status; |
1783 | } | 1794 | } |
1784 | 1795 | ||
1785 | int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac) | 1796 | static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac) |
1786 | { | 1797 | { |
1787 | struct list_head *entry, *next; | 1798 | struct list_head *entry, *next; |
1788 | u64 del_mac = 0; | 1799 | u64 del_mac = 0; |
@@ -1807,7 +1818,8 @@ int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac) | |||
1807 | return FALSE; | 1818 | return FALSE; |
1808 | } | 1819 | } |
1809 | /* delete a mac address from DA table */ | 1820 | /* delete a mac address from DA table */ |
1810 | enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev, struct macInfo *mac) | 1821 | static enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev, |
1822 | struct macInfo *mac) | ||
1811 | { | 1823 | { |
1812 | enum vxge_hw_status status = VXGE_HW_OK; | 1824 | enum vxge_hw_status status = VXGE_HW_OK; |
1813 | struct vxge_vpath *vpath; | 1825 | struct vxge_vpath *vpath; |
@@ -1854,7 +1866,7 @@ static vxge_search_mac_addr_in_da_table(struct vxge_vpath *vpath, | |||
1854 | } | 1866 | } |
1855 | 1867 | ||
1856 | /* Store all vlan ids from the list to the vid table */ | 1868 | /* Store all vlan ids from the list to the vid table */ |
1857 | enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath) | 1869 | static enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath) |
1858 | { | 1870 | { |
1859 | enum vxge_hw_status status = VXGE_HW_OK; | 1871 | enum vxge_hw_status status = VXGE_HW_OK; |
1860 | struct vxgedev *vdev = vpath->vdev; | 1872 | struct vxgedev *vdev = vpath->vdev; |
@@ -1874,7 +1886,7 @@ enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath) | |||
1874 | } | 1886 | } |
1875 | 1887 | ||
1876 | /* Store all mac addresses from the list to the DA table */ | 1888 | /* Store all mac addresses from the list to the DA table */ |
1877 | enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath) | 1889 | static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath) |
1878 | { | 1890 | { |
1879 | enum vxge_hw_status status = VXGE_HW_OK; | 1891 | enum vxge_hw_status status = VXGE_HW_OK; |
1880 | struct macInfo mac_info; | 1892 | struct macInfo mac_info; |
@@ -1916,7 +1928,7 @@ enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath) | |||
1916 | } | 1928 | } |
1917 | 1929 | ||
1918 | /* reset vpaths */ | 1930 | /* reset vpaths */ |
1919 | enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev) | 1931 | static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev) |
1920 | { | 1932 | { |
1921 | enum vxge_hw_status status = VXGE_HW_OK; | 1933 | enum vxge_hw_status status = VXGE_HW_OK; |
1922 | struct vxge_vpath *vpath; | 1934 | struct vxge_vpath *vpath; |
@@ -1948,7 +1960,7 @@ enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev) | |||
1948 | } | 1960 | } |
1949 | 1961 | ||
1950 | /* close vpaths */ | 1962 | /* close vpaths */ |
1951 | void vxge_close_vpaths(struct vxgedev *vdev, int index) | 1963 | static void vxge_close_vpaths(struct vxgedev *vdev, int index) |
1952 | { | 1964 | { |
1953 | struct vxge_vpath *vpath; | 1965 | struct vxge_vpath *vpath; |
1954 | int i; | 1966 | int i; |
@@ -1966,7 +1978,7 @@ void vxge_close_vpaths(struct vxgedev *vdev, int index) | |||
1966 | } | 1978 | } |
1967 | 1979 | ||
1968 | /* open vpaths */ | 1980 | /* open vpaths */ |
1969 | int vxge_open_vpaths(struct vxgedev *vdev) | 1981 | static int vxge_open_vpaths(struct vxgedev *vdev) |
1970 | { | 1982 | { |
1971 | struct vxge_hw_vpath_attr attr; | 1983 | struct vxge_hw_vpath_attr attr; |
1972 | enum vxge_hw_status status; | 1984 | enum vxge_hw_status status; |
@@ -2517,7 +2529,7 @@ static void vxge_poll_vp_lockup(unsigned long data) | |||
2517 | * Return value: '0' on success and an appropriate (-)ve integer as | 2529 | * Return value: '0' on success and an appropriate (-)ve integer as |
2518 | * defined in errno.h file on failure. | 2530 | * defined in errno.h file on failure. |
2519 | */ | 2531 | */ |
2520 | int | 2532 | static int |
2521 | vxge_open(struct net_device *dev) | 2533 | vxge_open(struct net_device *dev) |
2522 | { | 2534 | { |
2523 | enum vxge_hw_status status; | 2535 | enum vxge_hw_status status; |
@@ -2721,7 +2733,7 @@ out0: | |||
2721 | } | 2733 | } |
2722 | 2734 | ||
2723 | /* Loop throught the mac address list and delete all the entries */ | 2735 | /* Loop throught the mac address list and delete all the entries */ |
2724 | void vxge_free_mac_add_list(struct vxge_vpath *vpath) | 2736 | static void vxge_free_mac_add_list(struct vxge_vpath *vpath) |
2725 | { | 2737 | { |
2726 | 2738 | ||
2727 | struct list_head *entry, *next; | 2739 | struct list_head *entry, *next; |
@@ -2745,7 +2757,7 @@ static void vxge_napi_del_all(struct vxgedev *vdev) | |||
2745 | } | 2757 | } |
2746 | } | 2758 | } |
2747 | 2759 | ||
2748 | int do_vxge_close(struct net_device *dev, int do_io) | 2760 | static int do_vxge_close(struct net_device *dev, int do_io) |
2749 | { | 2761 | { |
2750 | enum vxge_hw_status status; | 2762 | enum vxge_hw_status status; |
2751 | struct vxgedev *vdev; | 2763 | struct vxgedev *vdev; |
@@ -2856,7 +2868,7 @@ int do_vxge_close(struct net_device *dev, int do_io) | |||
2856 | * Return value: '0' on success and an appropriate (-)ve integer as | 2868 | * Return value: '0' on success and an appropriate (-)ve integer as |
2857 | * defined in errno.h file on failure. | 2869 | * defined in errno.h file on failure. |
2858 | */ | 2870 | */ |
2859 | int | 2871 | static int |
2860 | vxge_close(struct net_device *dev) | 2872 | vxge_close(struct net_device *dev) |
2861 | { | 2873 | { |
2862 | do_vxge_close(dev, 1); | 2874 | do_vxge_close(dev, 1); |
@@ -3113,10 +3125,10 @@ static const struct net_device_ops vxge_netdev_ops = { | |||
3113 | #endif | 3125 | #endif |
3114 | }; | 3126 | }; |
3115 | 3127 | ||
3116 | int __devinit vxge_device_register(struct __vxge_hw_device *hldev, | 3128 | static int __devinit vxge_device_register(struct __vxge_hw_device *hldev, |
3117 | struct vxge_config *config, | 3129 | struct vxge_config *config, |
3118 | int high_dma, int no_of_vpath, | 3130 | int high_dma, int no_of_vpath, |
3119 | struct vxgedev **vdev_out) | 3131 | struct vxgedev **vdev_out) |
3120 | { | 3132 | { |
3121 | struct net_device *ndev; | 3133 | struct net_device *ndev; |
3122 | enum vxge_hw_status status = VXGE_HW_OK; | 3134 | enum vxge_hw_status status = VXGE_HW_OK; |
@@ -3164,7 +3176,7 @@ int __devinit vxge_device_register(struct __vxge_hw_device *hldev, | |||
3164 | 3176 | ||
3165 | ndev->watchdog_timeo = VXGE_LL_WATCH_DOG_TIMEOUT; | 3177 | ndev->watchdog_timeo = VXGE_LL_WATCH_DOG_TIMEOUT; |
3166 | 3178 | ||
3167 | initialize_ethtool_ops(ndev); | 3179 | vxge_initialize_ethtool_ops(ndev); |
3168 | 3180 | ||
3169 | /* Allocate memory for vpath */ | 3181 | /* Allocate memory for vpath */ |
3170 | vdev->vpaths = kzalloc((sizeof(struct vxge_vpath)) * | 3182 | vdev->vpaths = kzalloc((sizeof(struct vxge_vpath)) * |
@@ -3249,7 +3261,7 @@ _out0: | |||
3249 | * | 3261 | * |
3250 | * This function will unregister and free network device | 3262 | * This function will unregister and free network device |
3251 | */ | 3263 | */ |
3252 | void | 3264 | static void |
3253 | vxge_device_unregister(struct __vxge_hw_device *hldev) | 3265 | vxge_device_unregister(struct __vxge_hw_device *hldev) |
3254 | { | 3266 | { |
3255 | struct vxgedev *vdev; | 3267 | struct vxgedev *vdev; |
diff --git a/drivers/net/vxge/vxge-main.h b/drivers/net/vxge/vxge-main.h index d4be07eaacd..de64536cb7d 100644 --- a/drivers/net/vxge/vxge-main.h +++ b/drivers/net/vxge/vxge-main.h | |||
@@ -396,64 +396,7 @@ struct vxge_tx_priv { | |||
396 | mod_timer(&timer, (jiffies + exp)); \ | 396 | mod_timer(&timer, (jiffies + exp)); \ |
397 | } while (0); | 397 | } while (0); |
398 | 398 | ||
399 | int __devinit vxge_device_register(struct __vxge_hw_device *devh, | 399 | extern void vxge_initialize_ethtool_ops(struct net_device *ndev); |
400 | struct vxge_config *config, | ||
401 | int high_dma, int no_of_vpath, | ||
402 | struct vxgedev **vdev); | ||
403 | |||
404 | void vxge_device_unregister(struct __vxge_hw_device *devh); | ||
405 | |||
406 | void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id); | ||
407 | |||
408 | void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id); | ||
409 | |||
410 | void vxge_callback_link_up(struct __vxge_hw_device *devh); | ||
411 | |||
412 | void vxge_callback_link_down(struct __vxge_hw_device *devh); | ||
413 | |||
414 | enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, | ||
415 | struct macInfo *mac); | ||
416 | |||
417 | int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac); | ||
418 | |||
419 | int vxge_reset(struct vxgedev *vdev); | ||
420 | |||
421 | enum vxge_hw_status | ||
422 | vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr, | ||
423 | u8 t_code, void *userdata); | ||
424 | |||
425 | enum vxge_hw_status | ||
426 | vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, | ||
427 | enum vxge_hw_fifo_tcode t_code, void *userdata, | ||
428 | struct sk_buff ***skb_ptr, int nr_skbs, int *more); | ||
429 | |||
430 | int vxge_close(struct net_device *dev); | ||
431 | |||
432 | int vxge_open(struct net_device *dev); | ||
433 | |||
434 | void vxge_close_vpaths(struct vxgedev *vdev, int index); | ||
435 | |||
436 | int vxge_open_vpaths(struct vxgedev *vdev); | ||
437 | |||
438 | enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev); | ||
439 | |||
440 | enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, | ||
441 | struct macInfo *mac); | ||
442 | |||
443 | enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev, | ||
444 | struct macInfo *mac); | ||
445 | |||
446 | int vxge_mac_list_add(struct vxge_vpath *vpath, | ||
447 | struct macInfo *mac); | ||
448 | |||
449 | void vxge_free_mac_add_list(struct vxge_vpath *vpath); | ||
450 | |||
451 | enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath); | ||
452 | |||
453 | enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath); | ||
454 | |||
455 | int do_vxge_close(struct net_device *dev, int do_io); | ||
456 | extern void initialize_ethtool_ops(struct net_device *ndev); | ||
457 | /** | 400 | /** |
458 | * #define VXGE_DEBUG_INIT: debug for initialization functions | 401 | * #define VXGE_DEBUG_INIT: debug for initialization functions |
459 | * #define VXGE_DEBUG_TX : debug transmit related functions | 402 | * #define VXGE_DEBUG_TX : debug transmit related functions |
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c index cedf08f99cb..4bdb611a684 100644 --- a/drivers/net/vxge/vxge-traffic.c +++ b/drivers/net/vxge/vxge-traffic.c | |||
@@ -17,6 +17,13 @@ | |||
17 | #include "vxge-config.h" | 17 | #include "vxge-config.h" |
18 | #include "vxge-main.h" | 18 | #include "vxge-main.h" |
19 | 19 | ||
20 | static enum vxge_hw_status | ||
21 | __vxge_hw_device_handle_error(struct __vxge_hw_device *hldev, | ||
22 | u32 vp_id, enum vxge_hw_event type); | ||
23 | static enum vxge_hw_status | ||
24 | __vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath, | ||
25 | u32 skip_alarms); | ||
26 | |||
20 | /* | 27 | /* |
21 | * vxge_hw_vpath_intr_enable - Enable vpath interrupts. | 28 | * vxge_hw_vpath_intr_enable - Enable vpath interrupts. |
22 | * @vp: Virtual Path handle. | 29 | * @vp: Virtual Path handle. |
@@ -513,7 +520,7 @@ exit: | |||
513 | * Link up indication handler. The function is invoked by HW when | 520 | * Link up indication handler. The function is invoked by HW when |
514 | * Titan indicates that the link is up for programmable amount of time. | 521 | * Titan indicates that the link is up for programmable amount of time. |
515 | */ | 522 | */ |
516 | enum vxge_hw_status | 523 | static enum vxge_hw_status |
517 | __vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev) | 524 | __vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev) |
518 | { | 525 | { |
519 | /* | 526 | /* |
@@ -538,7 +545,7 @@ exit: | |||
538 | * Link down indication handler. The function is invoked by HW when | 545 | * Link down indication handler. The function is invoked by HW when |
539 | * Titan indicates that the link is down. | 546 | * Titan indicates that the link is down. |
540 | */ | 547 | */ |
541 | enum vxge_hw_status | 548 | static enum vxge_hw_status |
542 | __vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev) | 549 | __vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev) |
543 | { | 550 | { |
544 | /* | 551 | /* |
@@ -564,7 +571,7 @@ exit: | |||
564 | * | 571 | * |
565 | * Handle error. | 572 | * Handle error. |
566 | */ | 573 | */ |
567 | enum vxge_hw_status | 574 | static enum vxge_hw_status |
568 | __vxge_hw_device_handle_error( | 575 | __vxge_hw_device_handle_error( |
569 | struct __vxge_hw_device *hldev, | 576 | struct __vxge_hw_device *hldev, |
570 | u32 vp_id, | 577 | u32 vp_id, |
@@ -646,7 +653,7 @@ void vxge_hw_device_clear_tx_rx(struct __vxge_hw_device *hldev) | |||
646 | * it swaps the reserve and free arrays. | 653 | * it swaps the reserve and free arrays. |
647 | * | 654 | * |
648 | */ | 655 | */ |
649 | enum vxge_hw_status | 656 | static enum vxge_hw_status |
650 | vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh) | 657 | vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh) |
651 | { | 658 | { |
652 | void **tmp_arr; | 659 | void **tmp_arr; |
@@ -692,7 +699,8 @@ _alloc_after_swap: | |||
692 | * Posts a dtr to work array. | 699 | * Posts a dtr to work array. |
693 | * | 700 | * |
694 | */ | 701 | */ |
695 | void vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh) | 702 | static void vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, |
703 | void *dtrh) | ||
696 | { | 704 | { |
697 | vxge_assert(channel->work_arr[channel->post_index] == NULL); | 705 | vxge_assert(channel->work_arr[channel->post_index] == NULL); |
698 | 706 | ||
@@ -1658,37 +1666,6 @@ exit: | |||
1658 | } | 1666 | } |
1659 | 1667 | ||
1660 | /** | 1668 | /** |
1661 | * vxge_hw_vpath_vid_get_next - Get the next vid entry for this vpath | ||
1662 | * from vlan id table. | ||
1663 | * @vp: Vpath handle. | ||
1664 | * @vid: Buffer to return vlan id | ||
1665 | * | ||
1666 | * Returns the next vlan id in the list for this vpath. | ||
1667 | * see also: vxge_hw_vpath_vid_get | ||
1668 | * | ||
1669 | */ | ||
1670 | enum vxge_hw_status | ||
1671 | vxge_hw_vpath_vid_get_next(struct __vxge_hw_vpath_handle *vp, u64 *vid) | ||
1672 | { | ||
1673 | u64 data; | ||
1674 | enum vxge_hw_status status = VXGE_HW_OK; | ||
1675 | |||
1676 | if (vp == NULL) { | ||
1677 | status = VXGE_HW_ERR_INVALID_HANDLE; | ||
1678 | goto exit; | ||
1679 | } | ||
1680 | |||
1681 | status = __vxge_hw_vpath_rts_table_get(vp, | ||
1682 | VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_NEXT_ENTRY, | ||
1683 | VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_VID, | ||
1684 | 0, vid, &data); | ||
1685 | |||
1686 | *vid = VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_VLAN_ID(*vid); | ||
1687 | exit: | ||
1688 | return status; | ||
1689 | } | ||
1690 | |||
1691 | /** | ||
1692 | * vxge_hw_vpath_vid_delete - Delete the vlan id entry for this vpath | 1669 | * vxge_hw_vpath_vid_delete - Delete the vlan id entry for this vpath |
1693 | * to vlan id table. | 1670 | * to vlan id table. |
1694 | * @vp: Vpath handle. | 1671 | * @vp: Vpath handle. |
@@ -1898,9 +1875,9 @@ exit: | |||
1898 | * Process vpath alarms. | 1875 | * Process vpath alarms. |
1899 | * | 1876 | * |
1900 | */ | 1877 | */ |
1901 | enum vxge_hw_status __vxge_hw_vpath_alarm_process( | 1878 | static enum vxge_hw_status |
1902 | struct __vxge_hw_virtualpath *vpath, | 1879 | __vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath, |
1903 | u32 skip_alarms) | 1880 | u32 skip_alarms) |
1904 | { | 1881 | { |
1905 | u64 val64; | 1882 | u64 val64; |
1906 | u64 alarm_status; | 1883 | u64 alarm_status; |
@@ -2265,36 +2242,6 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw_vpath_handle *vp, int msix_id) | |||
2265 | } | 2242 | } |
2266 | 2243 | ||
2267 | /** | 2244 | /** |
2268 | * vxge_hw_vpath_msix_clear - Clear MSIX Vector. | ||
2269 | * @vp: Virtual Path handle. | ||
2270 | * @msix_id: MSI ID | ||
2271 | * | ||
2272 | * The function clears the msix interrupt for the given msix_id | ||
2273 | * | ||
2274 | * Returns: 0, | ||
2275 | * Otherwise, VXGE_HW_ERR_WRONG_IRQ if the msix index is out of range | ||
2276 | * status. | ||
2277 | * See also: | ||
2278 | */ | ||
2279 | void | ||
2280 | vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vp, int msix_id) | ||
2281 | { | ||
2282 | struct __vxge_hw_device *hldev = vp->vpath->hldev; | ||
2283 | if (hldev->config.intr_mode == | ||
2284 | VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) { | ||
2285 | __vxge_hw_pio_mem_write32_upper( | ||
2286 | (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32), | ||
2287 | &hldev->common_reg-> | ||
2288 | clr_msix_one_shot_vec[msix_id%4]); | ||
2289 | } else { | ||
2290 | __vxge_hw_pio_mem_write32_upper( | ||
2291 | (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32), | ||
2292 | &hldev->common_reg-> | ||
2293 | clear_msix_mask_vect[msix_id%4]); | ||
2294 | } | ||
2295 | } | ||
2296 | |||
2297 | /** | ||
2298 | * vxge_hw_vpath_msix_unmask - Unmask the MSIX Vector. | 2245 | * vxge_hw_vpath_msix_unmask - Unmask the MSIX Vector. |
2299 | * @vp: Virtual Path handle. | 2246 | * @vp: Virtual Path handle. |
2300 | * @msix_id: MSI ID | 2247 | * @msix_id: MSI ID |
@@ -2316,22 +2263,6 @@ vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vp, int msix_id) | |||
2316 | } | 2263 | } |
2317 | 2264 | ||
2318 | /** | 2265 | /** |
2319 | * vxge_hw_vpath_msix_mask_all - Mask all MSIX vectors for the vpath. | ||
2320 | * @vp: Virtual Path handle. | ||
2321 | * | ||
2322 | * The function masks all msix interrupt for the given vpath | ||
2323 | * | ||
2324 | */ | ||
2325 | void | ||
2326 | vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vp) | ||
2327 | { | ||
2328 | |||
2329 | __vxge_hw_pio_mem_write32_upper( | ||
2330 | (u32)vxge_bVALn(vxge_mBIT(vp->vpath->vp_id), 0, 32), | ||
2331 | &vp->vpath->hldev->common_reg->set_msix_mask_all_vect); | ||
2332 | } | ||
2333 | |||
2334 | /** | ||
2335 | * vxge_hw_vpath_inta_mask_tx_rx - Mask Tx and Rx interrupts. | 2266 | * vxge_hw_vpath_inta_mask_tx_rx - Mask Tx and Rx interrupts. |
2336 | * @vp: Virtual Path handle. | 2267 | * @vp: Virtual Path handle. |
2337 | * | 2268 | * |
diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h index 6fa07d13798..9890d4d596d 100644 --- a/drivers/net/vxge/vxge-traffic.h +++ b/drivers/net/vxge/vxge-traffic.h | |||
@@ -1749,14 +1749,6 @@ vxge_hw_mrpcim_stats_access( | |||
1749 | u64 *stat); | 1749 | u64 *stat); |
1750 | 1750 | ||
1751 | enum vxge_hw_status | 1751 | enum vxge_hw_status |
1752 | vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *devh, u32 port, | ||
1753 | struct vxge_hw_xmac_aggr_stats *aggr_stats); | ||
1754 | |||
1755 | enum vxge_hw_status | ||
1756 | vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *devh, u32 port, | ||
1757 | struct vxge_hw_xmac_port_stats *port_stats); | ||
1758 | |||
1759 | enum vxge_hw_status | ||
1760 | vxge_hw_device_xmac_stats_get(struct __vxge_hw_device *devh, | 1752 | vxge_hw_device_xmac_stats_get(struct __vxge_hw_device *devh, |
1761 | struct vxge_hw_xmac_stats *xmac_stats); | 1753 | struct vxge_hw_xmac_stats *xmac_stats); |
1762 | 1754 | ||
@@ -2117,49 +2109,10 @@ struct __vxge_hw_ring_rxd_priv { | |||
2117 | #endif | 2109 | #endif |
2118 | }; | 2110 | }; |
2119 | 2111 | ||
2120 | /* ========================= RING PRIVATE API ============================= */ | ||
2121 | u64 | ||
2122 | __vxge_hw_ring_first_block_address_get( | ||
2123 | struct __vxge_hw_ring *ringh); | ||
2124 | |||
2125 | enum vxge_hw_status | ||
2126 | __vxge_hw_ring_create( | ||
2127 | struct __vxge_hw_vpath_handle *vpath_handle, | ||
2128 | struct vxge_hw_ring_attr *attr); | ||
2129 | |||
2130 | enum vxge_hw_status | ||
2131 | __vxge_hw_ring_abort( | ||
2132 | struct __vxge_hw_ring *ringh); | ||
2133 | |||
2134 | enum vxge_hw_status | ||
2135 | __vxge_hw_ring_reset( | ||
2136 | struct __vxge_hw_ring *ringh); | ||
2137 | |||
2138 | enum vxge_hw_status | ||
2139 | __vxge_hw_ring_delete( | ||
2140 | struct __vxge_hw_vpath_handle *vpath_handle); | ||
2141 | |||
2142 | /* ========================= FIFO PRIVATE API ============================= */ | 2112 | /* ========================= FIFO PRIVATE API ============================= */ |
2143 | 2113 | ||
2144 | struct vxge_hw_fifo_attr; | 2114 | struct vxge_hw_fifo_attr; |
2145 | 2115 | ||
2146 | enum vxge_hw_status | ||
2147 | __vxge_hw_fifo_create( | ||
2148 | struct __vxge_hw_vpath_handle *vpath_handle, | ||
2149 | struct vxge_hw_fifo_attr *attr); | ||
2150 | |||
2151 | enum vxge_hw_status | ||
2152 | __vxge_hw_fifo_abort( | ||
2153 | struct __vxge_hw_fifo *fifoh); | ||
2154 | |||
2155 | enum vxge_hw_status | ||
2156 | __vxge_hw_fifo_reset( | ||
2157 | struct __vxge_hw_fifo *ringh); | ||
2158 | |||
2159 | enum vxge_hw_status | ||
2160 | __vxge_hw_fifo_delete( | ||
2161 | struct __vxge_hw_vpath_handle *vpath_handle); | ||
2162 | |||
2163 | struct vxge_hw_mempool_cbs { | 2116 | struct vxge_hw_mempool_cbs { |
2164 | void (*item_func_alloc)( | 2117 | void (*item_func_alloc)( |
2165 | struct vxge_hw_mempool *mempoolh, | 2118 | struct vxge_hw_mempool *mempoolh, |
@@ -2169,10 +2122,6 @@ struct vxge_hw_mempool_cbs { | |||
2169 | u32 is_last); | 2122 | u32 is_last); |
2170 | }; | 2123 | }; |
2171 | 2124 | ||
2172 | void | ||
2173 | __vxge_hw_mempool_destroy( | ||
2174 | struct vxge_hw_mempool *mempool); | ||
2175 | |||
2176 | #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath) \ | 2125 | #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath) \ |
2177 | ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next) | 2126 | ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next) |
2178 | 2127 | ||
@@ -2195,61 +2144,10 @@ __vxge_hw_vpath_rts_table_set( | |||
2195 | u64 data2); | 2144 | u64 data2); |
2196 | 2145 | ||
2197 | enum vxge_hw_status | 2146 | enum vxge_hw_status |
2198 | __vxge_hw_vpath_reset( | ||
2199 | struct __vxge_hw_device *devh, | ||
2200 | u32 vp_id); | ||
2201 | |||
2202 | enum vxge_hw_status | ||
2203 | __vxge_hw_vpath_sw_reset( | ||
2204 | struct __vxge_hw_device *devh, | ||
2205 | u32 vp_id); | ||
2206 | |||
2207 | enum vxge_hw_status | ||
2208 | __vxge_hw_vpath_enable( | 2147 | __vxge_hw_vpath_enable( |
2209 | struct __vxge_hw_device *devh, | 2148 | struct __vxge_hw_device *devh, |
2210 | u32 vp_id); | 2149 | u32 vp_id); |
2211 | 2150 | ||
2212 | void | ||
2213 | __vxge_hw_vpath_prc_configure( | ||
2214 | struct __vxge_hw_device *devh, | ||
2215 | u32 vp_id); | ||
2216 | |||
2217 | enum vxge_hw_status | ||
2218 | __vxge_hw_vpath_kdfc_configure( | ||
2219 | struct __vxge_hw_device *devh, | ||
2220 | u32 vp_id); | ||
2221 | |||
2222 | enum vxge_hw_status | ||
2223 | __vxge_hw_vpath_mac_configure( | ||
2224 | struct __vxge_hw_device *devh, | ||
2225 | u32 vp_id); | ||
2226 | |||
2227 | enum vxge_hw_status | ||
2228 | __vxge_hw_vpath_tim_configure( | ||
2229 | struct __vxge_hw_device *devh, | ||
2230 | u32 vp_id); | ||
2231 | |||
2232 | enum vxge_hw_status | ||
2233 | __vxge_hw_vpath_initialize( | ||
2234 | struct __vxge_hw_device *devh, | ||
2235 | u32 vp_id); | ||
2236 | |||
2237 | enum vxge_hw_status | ||
2238 | __vxge_hw_vp_initialize( | ||
2239 | struct __vxge_hw_device *devh, | ||
2240 | u32 vp_id, | ||
2241 | struct vxge_hw_vp_config *config); | ||
2242 | |||
2243 | void | ||
2244 | __vxge_hw_vp_terminate( | ||
2245 | struct __vxge_hw_device *devh, | ||
2246 | u32 vp_id); | ||
2247 | |||
2248 | enum vxge_hw_status | ||
2249 | __vxge_hw_vpath_alarm_process( | ||
2250 | struct __vxge_hw_virtualpath *vpath, | ||
2251 | u32 skip_alarms); | ||
2252 | |||
2253 | void vxge_hw_device_intr_enable( | 2151 | void vxge_hw_device_intr_enable( |
2254 | struct __vxge_hw_device *devh); | 2152 | struct __vxge_hw_device *devh); |
2255 | 2153 | ||
@@ -2321,11 +2219,6 @@ vxge_hw_vpath_vid_get( | |||
2321 | u64 *vid); | 2219 | u64 *vid); |
2322 | 2220 | ||
2323 | enum vxge_hw_status | 2221 | enum vxge_hw_status |
2324 | vxge_hw_vpath_vid_get_next( | ||
2325 | struct __vxge_hw_vpath_handle *vpath_handle, | ||
2326 | u64 *vid); | ||
2327 | |||
2328 | enum vxge_hw_status | ||
2329 | vxge_hw_vpath_vid_delete( | 2222 | vxge_hw_vpath_vid_delete( |
2330 | struct __vxge_hw_vpath_handle *vpath_handle, | 2223 | struct __vxge_hw_vpath_handle *vpath_handle, |
2331 | u64 vid); | 2224 | u64 vid); |
@@ -2387,16 +2280,9 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw_vpath_handle *vpath_handle, | |||
2387 | void vxge_hw_device_flush_io(struct __vxge_hw_device *devh); | 2280 | void vxge_hw_device_flush_io(struct __vxge_hw_device *devh); |
2388 | 2281 | ||
2389 | void | 2282 | void |
2390 | vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vpath_handle, | ||
2391 | int msix_id); | ||
2392 | |||
2393 | void | ||
2394 | vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vpath_handle, | 2283 | vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vpath_handle, |
2395 | int msix_id); | 2284 | int msix_id); |
2396 | 2285 | ||
2397 | void | ||
2398 | vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vpath_handle); | ||
2399 | |||
2400 | enum vxge_hw_status vxge_hw_vpath_intr_enable( | 2286 | enum vxge_hw_status vxge_hw_vpath_intr_enable( |
2401 | struct __vxge_hw_vpath_handle *vpath_handle); | 2287 | struct __vxge_hw_vpath_handle *vpath_handle); |
2402 | 2288 | ||
@@ -2415,12 +2301,6 @@ vxge_hw_channel_msix_mask(struct __vxge_hw_channel *channelh, int msix_id); | |||
2415 | void | 2301 | void |
2416 | vxge_hw_channel_msix_unmask(struct __vxge_hw_channel *channelh, int msix_id); | 2302 | vxge_hw_channel_msix_unmask(struct __vxge_hw_channel *channelh, int msix_id); |
2417 | 2303 | ||
2418 | enum vxge_hw_status | ||
2419 | vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh); | ||
2420 | |||
2421 | void | ||
2422 | vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh); | ||
2423 | |||
2424 | void | 2304 | void |
2425 | vxge_hw_channel_dtr_try_complete(struct __vxge_hw_channel *channel, | 2305 | vxge_hw_channel_dtr_try_complete(struct __vxge_hw_channel *channel, |
2426 | void **dtrh); | 2306 | void **dtrh); |
@@ -2436,18 +2316,4 @@ vxge_hw_channel_dtr_count(struct __vxge_hw_channel *channel); | |||
2436 | void | 2316 | void |
2437 | vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id); | 2317 | vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id); |
2438 | 2318 | ||
2439 | /* ========================== PRIVATE API ================================= */ | ||
2440 | |||
2441 | enum vxge_hw_status | ||
2442 | __vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev); | ||
2443 | |||
2444 | enum vxge_hw_status | ||
2445 | __vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev); | ||
2446 | |||
2447 | enum vxge_hw_status | ||
2448 | __vxge_hw_device_handle_error( | ||
2449 | struct __vxge_hw_device *hldev, | ||
2450 | u32 vp_id, | ||
2451 | enum vxge_hw_event type); | ||
2452 | |||
2453 | #endif | 2319 | #endif |