Subject: [PATCH] via-velocity: classical linux vlan api - step by step ...but I'd be quite surprized that this one works at all. --- drivers/net/Kconfig | 9 +++++++++ drivers/net/via-velocity.c | 25 +++++++------------------ drivers/net/via-velocity.h | 2 ++ 3 files changed, 18 insertions(+), 18 deletions(-) applies-to: a71598a307617904319c454dbf8ee4881804d5ec 358e926153ece345fe97707e95ac51c8ef4e4d52 diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index ebd7313..c11b8b7 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -2100,6 +2100,15 @@ config VIA_VELOCITY To compile this driver as a module, choose M here. The module will be called via-velocity. +config VIA_VELOCITY_VLAN + bool "VLAN support" + depends on VIA_VELOCITY && VLAN_8021Q + help + Say Y here for the via-velocity driver to support the functions + required by the kernel 802.1Q code. + + If in doubt, say Y. + config TIGON3 tristate "Broadcom Tigon3 support" depends on PCI diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 1610e4c..ee6e5c3 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c @@ -114,15 +114,6 @@ VELOCITY_PARAM(RxDescriptors, "Number of #define TX_DESC_DEF 64 VELOCITY_PARAM(TxDescriptors, "Number of transmit descriptors"); -#define VLAN_ID_MIN 0 -#define VLAN_ID_MAX 4095 -#define VLAN_ID_DEF 0 -/* VID_setting[] is used for setting the VID of NIC. - 0: default VID. - 1-4094: other VIDs. -*/ -VELOCITY_PARAM(VID_setting, "802.1Q VLAN ID"); - #define RX_THRESH_MIN 0 #define RX_THRESH_MAX 3 #define RX_THRESH_DEF 0 @@ -150,13 +141,6 @@ VELOCITY_PARAM(rx_thresh, "Receive fifo */ VELOCITY_PARAM(DMA_length, "DMA length"); -#define TAGGING_DEF 0 -/* enable_tagging[] is used for enabling 802.1Q VID tagging. - 0: disable VID seeting(default). - 1: enable VID setting. -*/ -VELOCITY_PARAM(enable_tagging, "Enable 802.1Q tagging"); - #define IP_ALIG_DEF 0 /* IP_byte_align[] is used for IP header DWORD byte aligned 0: indicate the IP header won't be DWORD byte aligned.(Default) . @@ -562,8 +546,6 @@ static void __devinit velocity_get_optio velocity_set_int_opt(&opts->DMA_length, DMA_length[index], DMA_LENGTH_MIN, DMA_LENGTH_MAX, DMA_LENGTH_DEF, "DMA_length", devname); velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname); velocity_set_int_opt(&opts->numtx, TxDescriptors[index], TX_DESC_MIN, TX_DESC_MAX, TX_DESC_DEF, "TxDescriptors", devname); - velocity_set_int_opt(&opts->vid, VID_setting[index], VLAN_ID_MIN, VLAN_ID_MAX, VLAN_ID_DEF, "VID_setting", devname); - velocity_set_bool_opt(&opts->flags, enable_tagging[index], TAGGING_DEF, VELOCITY_FLAGS_TAGGING, "enable_tagging", devname); velocity_set_bool_opt(&opts->flags, txcsum_offload[index], TX_CSUM_DEF, VELOCITY_FLAGS_TX_CSUM, "txcsum_offload", devname); velocity_set_int_opt(&opts->flow_cntl, flow_control[index], FLOW_CNTL_MIN, FLOW_CNTL_MAX, FLOW_CNTL_DEF, "flow_control", devname); velocity_set_bool_opt(&opts->flags, IP_byte_align[index], IP_ALIG_DEF, VELOCITY_FLAGS_IP_ALIGN, "IP_byte_align", devname); @@ -901,6 +883,13 @@ static int __devinit velocity_found1(str dev->features |= NETIF_F_SG; #endif +#ifdef CONFIG_VIA_VELOCITY_VLAN + dev->vlan_rx_register = velocity_vlan_rx_register; + dev->vlan_rx_kill_vid = velocity_vlan_rx_kill_vid; + dev->vlan_rx_add_vid = velocity_vlan_rx_add_vid; + dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; +#endif + if (vptr->flags & VELOCITY_FLAGS_TX_CSUM) { dev->features |= NETIF_F_HW_CSUM; } diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h index 1fff716..b09918d 100644 --- a/drivers/net/via-velocity.h +++ b/drivers/net/via-velocity.h @@ -1791,7 +1791,9 @@ struct velocity_info { u32 ticks; u32 rx_bytes; +#ifdef CONFIG_VIA_VELOCITY_VLAN struct vlan_group *vlgrp; +#endif }; /** --- 0.99.9a