|
9 | 9 |
|
10 | 10 | #include <netcope/ndp_core_queue.h>
|
11 | 11 | #include <netcope/ndp.h>
|
| 12 | +#include <netcope/rxqueue.h> |
| 13 | +#include <netcope/txqueue.h> |
12 | 14 |
|
13 | 15 | void *nfb_nalloc(int numa_node, size_t size)
|
14 | 16 | {
|
@@ -244,12 +246,24 @@ static inline int fdt_get_subnode_count(const void *fdt, const char *path)
|
244 | 246 | #ifndef __KERNEL__
|
245 | 247 | int ndp_get_rx_queue_count(const struct nfb_device *dev)
|
246 | 248 | {
|
247 |
| - return fdt_get_subnode_count(dev->fdt, "/drivers/ndp/rx_queues"); |
| 249 | + if (fdt_path_offset(dev->fdt, "/driver/ndp/") >= 0) { |
| 250 | + return fdt_get_subnode_count(dev->fdt, "/drivers/ndp/rx_queues"); |
| 251 | + } else { |
| 252 | + return |
| 253 | + nfb_comp_count(dev, COMP_NETCOPE_RXQUEUE_NDP) + |
| 254 | + nfb_comp_count(dev, COMP_NETCOPE_RXQUEUE_CALYPTE); |
| 255 | + } |
248 | 256 | }
|
249 | 257 |
|
250 | 258 | int ndp_get_tx_queue_count(const struct nfb_device *dev)
|
251 | 259 | {
|
252 |
| - return fdt_get_subnode_count(dev->fdt, "/drivers/ndp/tx_queues"); |
| 260 | + if (fdt_path_offset(dev->fdt, "/driver/ndp/") >= 0) { |
| 261 | + return fdt_get_subnode_count(dev->fdt, "/drivers/ndp/tx_queues"); |
| 262 | + } else { |
| 263 | + return |
| 264 | + nfb_comp_count(dev, COMP_NETCOPE_TXQUEUE_NDP) + |
| 265 | + nfb_comp_count(dev, COMP_NETCOPE_TXQUEUE_CALYPTE); |
| 266 | + } |
253 | 267 | }
|
254 | 268 |
|
255 | 269 | int ndp_queue_is_available(const struct nfb_device *dev, unsigned index, int dir)
|
|
0 commit comments