From: John Hodge Date: Sat, 24 May 2014 14:50:23 +0000 (+0800) Subject: UDI/net_ne2000 - Fix incompatabilities pointed out by [com]buster X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=adf8e7862b8375ba1d9b281be50fd5f9938ee662;p=tpg%2Facess2.git UDI/net_ne2000 - Fix incompatabilities pointed out by [com]buster --- diff --git a/UDI/drivers/net_ne2000/ne2000_common.h b/UDI/drivers/net_ne2000/ne2000_common.h index 6850c239..d4e58aa3 100644 --- a/UDI/drivers/net_ne2000/ne2000_common.h +++ b/UDI/drivers/net_ne2000/ne2000_common.h @@ -10,10 +10,12 @@ #define UDI_VERSION 0x101 #define UDI_PHYSIO_VERSION 0x101 +#define UDI_PCI_VERSION 0x101 #define UDI_NIC_VERSION 0x101 #include #include +#include #include #include "ne2000_hw.h" @@ -81,10 +83,15 @@ typedef struct (attr)->attr_type = UDI_ATTR_STRING; \ (attr)->attr_length = (len); \ udi_strncpy_rtrim((char *)(attr)->attr_value, (val), (len)) -#define NE2K_SET_ATTR_STRFMT(attr, name, maxlen, fmt, v...) \ +#define NE2K_SET_ATTR_STRFMT(attr, name, maxlen, fmt, ...) \ udi_strcpy((attr)->attr_name, (name)); \ (attr)->attr_type = UDI_ATTR_STRING; \ - (attr)->attr_length = udi_snprintf((char *)(attr)->attr_value, (maxlen), (fmt) ,## v ) + (attr)->attr_length = udi_snprintf((char *)(attr)->attr_value, (maxlen), (fmt) ,## __VA_ARGS__ ) + +extern udi_usage_ind_op_t ne2k_usage_ind; +extern udi_enumerate_req_op_t ne2k_enumerate_req; +extern udi_devmgmt_req_op_t ne2k_devmgmt_req; +extern udi_final_cleanup_req_op_t ne2k_final_cleanup_req; extern udi_channel_event_ind_op_t ne2k_bus_dev_channel_event_ind; extern udi_bus_bind_ack_op_t ne2k_bus_dev_bus_bind_ack; diff --git a/UDI/drivers/net_ne2000/ne2000_core.c b/UDI/drivers/net_ne2000/ne2000_core.c index 1ff7914a..d630a8d4 100644 --- a/UDI/drivers/net_ne2000/ne2000_core.c +++ b/UDI/drivers/net_ne2000/ne2000_core.c @@ -64,6 +64,9 @@ void ne2k_enumerate_req(udi_enumerate_cb_t *cb, udi_ubit8_t enumeration_level) case UDI_ENUMERATE_NEXT: udi_enumerate_ack(cb, UDI_ENUMERATE_DONE, 0); break; + default: + udi_assert(!"invalid enumeration_level"); + break; } } void ne2k_devmgmt_req(udi_mgmt_cb_t *cb, udi_ubit8_t mgmt_op, udi_ubit8_t parent_ID) @@ -88,6 +91,9 @@ void ne2k_bus_dev_channel_event_ind(udi_channel_event_cb_t *cb) udi_bus_bind_req( bus_bind_cb ); // continue at ne2k_bus_dev_bus_bind_ack return; } + default: + udi_assert(!"invalid channel event"); + break; } } void ne2k_bus_dev_bus_bind_ack(udi_bus_bind_cb_t *cb, @@ -238,7 +244,7 @@ void ne2k_nd_ctrl_bind__rx_chan_ok(udi_cb_t *gcb, udi_channel_t new_channel) cb->max_perfect_multicast = 0; cb->max_total_multicast = 0; cb->mac_addr_len = 6; - memcpy(cb->mac_addr, rdata->macaddr, 6); + udi_memcpy(cb->mac_addr, rdata->macaddr, 6); udi_nsr_bind_ack( cb, UDI_OK ); // = = = = } diff --git a/UDI/drivers/net_ne2000/ne2000_rx.c b/UDI/drivers/net_ne2000/ne2000_rx.c index 4cdd20f8..9b4b3c32 100644 --- a/UDI/drivers/net_ne2000/ne2000_rx.c +++ b/UDI/drivers/net_ne2000/ne2000_rx.c @@ -47,7 +47,7 @@ void ne2k_intr__rx_ok(udi_cb_t *gcb) rdata->rx_next_cb = rx_cb->chain; rx_cb->chain = NULL; udi_debug_printf("ne2k_intr__rx_ok: Initialising buffer\n"); - udi_buf_write(ne2k_rx__buf_allocated, UDI_GCB(rx_cb), NULL, 1520, rx_cb->rx_buf, 0, 0, NULL); + udi_buf_write(ne2k_rx__buf_allocated, UDI_GCB(rx_cb), NULL, 1520, rx_cb->rx_buf, 0, 0, UDI_NULL_BUF_PATH); } else {