diff options
author | Sreenivasa Honnur <Sreenivasa.Honnur@neterion.com> | 2009-10-04 21:56:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-06 18:22:54 -0400 |
commit | fa41fd10038ab575f043a62dace374e07e9193de (patch) | |
tree | add9b20df4537b846f0571871d7e7d751d037dc5 /drivers/net/vxge | |
parent | f0dfebafcc14a7456eb6ae974b68f600fdd8b42d (diff) |
vxge: Check if FCS stripping is disabled by the firmware.
- Added a function to check if FCS stripping is disabled by the firmware, if
it is not disabled fail driver load.
- By default FCS stripping is disabled by the firmware. With this assumption
driver decrements the indicated packet length by 4 bytes(FCS length).
- This patch ensures that FCS stripping is disabled during driver load time.
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge')
-rw-r--r-- | drivers/net/vxge/vxge-config.c | 22 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-config.h | 2 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-main.c | 9 |
3 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c index 933237ec38d8..c07a7379cfa7 100644 --- a/drivers/net/vxge/vxge-config.c +++ b/drivers/net/vxge/vxge-config.c | |||
@@ -2157,6 +2157,28 @@ exit: | |||
2157 | } | 2157 | } |
2158 | 2158 | ||
2159 | /* | 2159 | /* |
2160 | * vxge_hw_vpath_strip_fcs_check - Check for FCS strip. | ||
2161 | */ | ||
2162 | enum vxge_hw_status | ||
2163 | vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask) | ||
2164 | { | ||
2165 | struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg; | ||
2166 | enum vxge_hw_status status = VXGE_HW_OK; | ||
2167 | int i = 0, j = 0; | ||
2168 | |||
2169 | for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) { | ||
2170 | if (!((vpath_mask) & vxge_mBIT(i))) | ||
2171 | continue; | ||
2172 | vpmgmt_reg = hldev->vpmgmt_reg[i]; | ||
2173 | for (j = 0; j < VXGE_HW_MAC_MAX_MAC_PORT_ID; j++) { | ||
2174 | if (readq(&vpmgmt_reg->rxmac_cfg0_port_vpmgmt_clone[j]) | ||
2175 | & VXGE_HW_RXMAC_CFG0_PORT_VPMGMT_CLONE_STRIP_FCS) | ||
2176 | return VXGE_HW_FAIL; | ||
2177 | } | ||
2178 | } | ||
2179 | return status; | ||
2180 | } | ||
2181 | /* | ||
2160 | * vxge_hw_mgmt_reg_Write - Write Titan register. | 2182 | * vxge_hw_mgmt_reg_Write - Write Titan register. |
2161 | */ | 2183 | */ |
2162 | enum vxge_hw_status | 2184 | enum vxge_hw_status |
diff --git a/drivers/net/vxge/vxge-config.h b/drivers/net/vxge/vxge-config.h index 3e94f0ce0900..e7877df092f3 100644 --- a/drivers/net/vxge/vxge-config.h +++ b/drivers/net/vxge/vxge-config.h | |||
@@ -2201,6 +2201,8 @@ __vxge_hw_vpath_func_id_get( | |||
2201 | enum vxge_hw_status | 2201 | enum vxge_hw_status |
2202 | __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath); | 2202 | __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath); |
2203 | 2203 | ||
2204 | enum vxge_hw_status | ||
2205 | vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask); | ||
2204 | /** | 2206 | /** |
2205 | * vxge_debug | 2207 | * vxge_debug |
2206 | * @level: level of debug verbosity. | 2208 | * @level: level of debug verbosity. |
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index 7a851ac30c60..04ac4b6cf83a 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -4244,6 +4244,15 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
4244 | goto _exit3; | 4244 | goto _exit3; |
4245 | } | 4245 | } |
4246 | 4246 | ||
4247 | /* if FCS stripping is not disabled in MAC fail driver load */ | ||
4248 | if (vxge_hw_vpath_strip_fcs_check(hldev, vpath_mask) != VXGE_HW_OK) { | ||
4249 | vxge_debug_init(VXGE_ERR, | ||
4250 | "%s: FCS stripping is not disabled in MAC" | ||
4251 | " failing driver load", VXGE_DRIVER_NAME); | ||
4252 | ret = -EINVAL; | ||
4253 | goto _exit4; | ||
4254 | } | ||
4255 | |||
4247 | vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_LL); | 4256 | vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_LL); |
4248 | 4257 | ||
4249 | /* set private device info */ | 4258 | /* set private device info */ |