diff --git a/network/components/copy.c b/network/components/copy.c index 44bcc298d..cce328705 100644 --- a/network/components/copy.c +++ b/network/components/copy.c @@ -11,8 +11,7 @@ #include #include -__attribute__((__section__(".net_copy_config"))) -net_copy_config_t config; +__attribute__((__section__(".net_copy_config"))) net_copy_config_t config; net_queue_handle_t rx_queue_virt; net_queue_handle_t rx_queue_cli; @@ -91,8 +90,10 @@ void notified(microkit_channel ch) void init(void) { /* Set up the queues */ - net_queue_init(&rx_queue_cli, config.client.free_queue.vaddr, config.client.active_queue.vaddr, config.client.num_buffers); - net_queue_init(&rx_queue_virt, config.virt_rx.free_queue.vaddr, config.virt_rx.active_queue.vaddr, config.virt_rx.num_buffers); + net_queue_init(&rx_queue_cli, config.client.free_queue.vaddr, config.client.active_queue.vaddr, + config.client.num_buffers); + net_queue_init(&rx_queue_virt, config.virt_rx.free_queue.vaddr, config.virt_rx.active_queue.vaddr, + config.virt_rx.num_buffers); net_buffers_init(&rx_queue_cli, 0); } diff --git a/network/components/virt_rx.c b/network/components/virt_rx.c index 86433c4b6..231f2ea2c 100644 --- a/network/components/virt_rx.c +++ b/network/components/virt_rx.c @@ -18,8 +18,7 @@ * any particular client. */ #define BROADCAST_ID (-2) -__attribute__((__section__(".net_virt_rx_config"))) -net_virt_rx_config_t config; +__attribute__((__section__(".net_virt_rx_config"))) net_virt_rx_config_t config; /* In order to handle broadcast packets where the same buffer is given to multiple clients * we keep track of a reference count of each buffer and only hand it back to the driver once @@ -68,7 +67,7 @@ int get_mac_addr_match(struct ethernet_header *buffer) void rx_return(void) { bool reprocess = true; - bool notify_clients[SDDF_NET_MAX_CLIENTS] = {false}; + bool notify_clients[SDDF_NET_MAX_CLIENTS] = { false }; while (reprocess) { while (!net_queue_empty_active(&state.rx_queue_drv)) { net_buff_desc_t buffer; @@ -195,11 +194,13 @@ void init(void) /* Set up client queues */ for (int i = 0; i < config.num_clients; i++) { - net_queue_init(&state.rx_queue_clients[i], config.clients[i].conn.free_queue.vaddr, config.clients[i].conn.active_queue.vaddr, config.clients[i].conn.num_buffers); + net_queue_init(&state.rx_queue_clients[i], config.clients[i].conn.free_queue.vaddr, + config.clients[i].conn.active_queue.vaddr, config.clients[i].conn.num_buffers); } /* Set up driver queues */ - net_queue_init(&state.rx_queue_drv, config.driver.free_queue.vaddr, config.driver.active_queue.vaddr, config.driver.num_buffers); + net_queue_init(&state.rx_queue_drv, config.driver.free_queue.vaddr, config.driver.active_queue.vaddr, + config.driver.num_buffers); net_buffers_init(&state.rx_queue_drv, config.data.io_addr); if (net_require_signal_free(&state.rx_queue_drv)) { diff --git a/network/components/virt_tx.c b/network/components/virt_tx.c index af02e7c9e..5e20dbb41 100644 --- a/network/components/virt_tx.c +++ b/network/components/virt_tx.c @@ -10,8 +10,7 @@ #include #include -__attribute__((__section__(".net_virt_tx_config"))) -net_virt_tx_config_t config; +__attribute__((__section__(".net_virt_tx_config"))) net_virt_tx_config_t config; typedef struct state { net_queue_handle_t tx_queue_drv; @@ -24,7 +23,8 @@ int extract_offset(uintptr_t *phys) { for (int client = 0; client < config.num_clients; client++) { if (*phys >= config.clients[client].data.io_addr - && *phys < config.clients[client].data.io_addr + state.tx_queue_clients[client].capacity * NET_BUFFER_SIZE) { + && *phys + < config.clients[client].data.io_addr + state.tx_queue_clients[client].capacity * NET_BUFFER_SIZE) { *phys = *phys - config.clients[client].data.io_addr; return client; } @@ -80,7 +80,7 @@ void tx_provide(void) void tx_return(void) { bool reprocess = true; - bool notify_clients[SDDF_NET_MAX_CLIENTS] = {false}; + bool notify_clients[SDDF_NET_MAX_CLIENTS] = { false }; while (reprocess) { while (!net_queue_empty_free(&state.tx_queue_drv)) { net_buff_desc_t buffer; @@ -121,10 +121,12 @@ void notified(microkit_channel ch) void init(void) { /* Set up driver queues */ - net_queue_init(&state.tx_queue_drv, config.driver.free_queue.vaddr, config.driver.active_queue.vaddr, config.driver.num_buffers); + net_queue_init(&state.tx_queue_drv, config.driver.free_queue.vaddr, config.driver.active_queue.vaddr, + config.driver.num_buffers); for (int i = 0; i < config.num_clients; i++) { - net_queue_init(&state.tx_queue_clients[i], config.clients[i].conn.free_queue.vaddr, config.clients[i].conn.active_queue.vaddr, config.clients[i].conn.num_buffers); + net_queue_init(&state.tx_queue_clients[i], config.clients[i].conn.free_queue.vaddr, + config.clients[i].conn.active_queue.vaddr, config.clients[i].conn.num_buffers); } tx_provide();