aboutsummaryrefslogtreecommitdiffstats
path: root/package/broadcom-57xx/src/tcp_seg.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-06-15 11:11:28 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-06-15 11:11:28 +0000
commit567993fa4c6001197e3e25a57a4a0d718c372952 (patch)
tree628e1de7f62f279d851f47ad1ee6ab63c320c1c8 /package/broadcom-57xx/src/tcp_seg.c
parentd6b78c826aa67fb04e34c69c1b41eed843462bab (diff)
downloadmaster-187ad058-567993fa4c6001197e3e25a57a4a0d718c372952.tar.gz
master-187ad058-567993fa4c6001197e3e25a57a4a0d718c372952.tar.bz2
master-187ad058-567993fa4c6001197e3e25a57a4a0d718c372952.zip
(6/6) bcm57xx: package
This is the bcm57xx package. I have tested default vlan functions, but I dont have the equipment to test more advanced setups. The default vlan setup seems to be working fine. I also added the activate_gpio parameter which will make the driver activate the switch via gpio before probing for it. I'm not sure which method is best for autoload. For the wrt350n, I need the activate_gpio parameter. But its probably not a good idea to add that to the autoload file. On a system without a bcm57xx switch, isn't it a bad idea to mess with the gpios looking for the switch? Ideally, wouldn't it be best to load the bcm57xx module from broadcom-diag, after it has determined which router its on? I tried using 'request_module' from there, but had no success. For now, I am relying on preinit to load the bcm57xx module with activate_gpio param, after it has failed to load switch_robo and switch_adm. Signed-off-by: Ben Pfountz <netprince (at) vt (dot) edu> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11471 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/broadcom-57xx/src/tcp_seg.c')
-rw-r--r--package/broadcom-57xx/src/tcp_seg.c106
1 files changed, 106 insertions, 0 deletions
diff --git a/package/broadcom-57xx/src/tcp_seg.c b/package/broadcom-57xx/src/tcp_seg.c
new file mode 100644
index 0000000000..5a7c8f14a4
--- /dev/null
+++ b/package/broadcom-57xx/src/tcp_seg.c
@@ -0,0 +1,106 @@
+/******************************************************************************/
+/* */
+/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2002 - 2004 Broadcom */
+/* Corporation. */
+/* All rights reserved. */
+/* */
+/* This program is free software; you can redistribute it and/or modify */
+/* it under the terms of the GNU General Public License as published by */
+/* the Free Software Foundation, located in the file LICENSE. */
+/* */
+/* History: */
+/* */
+/******************************************************************************/
+
+#include "mm.h"
+
+#ifdef INCLUDE_TCP_SEG_SUPPORT
+#include "fw_stkoffld.h"
+#include "fw_lso05.h"
+
+LM_UINT32 LM_GetStkOffLdFirmwareSize(PLM_DEVICE_BLOCK pDevice)
+{
+ LM_UINT32 FwSize;
+
+ if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5750)
+ {
+ return 0;
+ }
+ if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5705)
+ {
+ FwSize = (LM_UINT32)(t3StkOffLd05FwTextLen +
+ t3StkOffLd05FwRodataLen +
+ t3StkOffLd05FwDataLen +
+ t3StkOffLd05FwSbssLen +
+ t3StkOffLd05FwBssLen);
+ }
+ else
+ {
+ FwSize = (LM_UINT32)(t3StkOffLdFwTextLen +
+ t3StkOffLdFwRodataLen +
+ t3StkOffLdFwDataLen +
+ t3StkOffLdFwSbssLen +
+ t3StkOffLdFwBssLen);
+ }
+
+ return FwSize;
+}
+
+LM_STATUS LM_LoadStkOffLdFirmware(PLM_DEVICE_BLOCK pDevice)
+{
+ T3_FWIMG_INFO FwImgInfo;
+ LM_UINT32 Cpu;
+
+ if (T3_ASIC_IS_575X_PLUS(pDevice->ChipRevId))
+ {
+ return LM_STATUS_SUCCESS;
+ }
+ if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5705)
+ {
+ FwImgInfo.StartAddress = t3StkOffLd05FwStartAddr;
+ FwImgInfo.Text.Buffer = (PLM_UINT8)t3StkOffLd05FwText;
+ FwImgInfo.Text.Offset = t3StkOffLd05FwTextAddr;
+ FwImgInfo.Text.Length = t3StkOffLd05FwTextLen;
+ FwImgInfo.ROnlyData.Buffer = (PLM_UINT8)t3StkOffLd05FwRodata;
+ FwImgInfo.ROnlyData.Offset = t3StkOffLd05FwRodataAddr;
+ FwImgInfo.ROnlyData.Length = t3StkOffLd05FwRodataLen;
+ FwImgInfo.Data.Buffer = (PLM_UINT8)t3StkOffLd05FwData;
+ FwImgInfo.Data.Offset = t3StkOffLd05FwDataAddr;
+ FwImgInfo.Data.Length = t3StkOffLd05FwDataLen;
+ FwImgInfo.Sbss.Offset = t3StkOffLd05FwSbssAddr;
+ FwImgInfo.Sbss.Length = t3StkOffLd05FwSbssLen;
+ FwImgInfo.Bss.Offset = t3StkOffLd05FwBssAddr;
+ FwImgInfo.Bss.Length = t3StkOffLd05FwBssLen;
+ Cpu = T3_RX_CPU_ID;
+ }
+ else
+ {
+ FwImgInfo.StartAddress = t3StkOffLdFwStartAddr;
+ FwImgInfo.Text.Buffer = (PLM_UINT8)t3StkOffLdFwText;
+ FwImgInfo.Text.Offset = t3StkOffLdFwTextAddr;
+ FwImgInfo.Text.Length = t3StkOffLdFwTextLen;
+ FwImgInfo.ROnlyData.Buffer = (PLM_UINT8)t3StkOffLdFwRodata;
+ FwImgInfo.ROnlyData.Offset = t3StkOffLdFwRodataAddr;
+ FwImgInfo.ROnlyData.Length = t3StkOffLdFwRodataLen;
+ FwImgInfo.Data.Buffer = (PLM_UINT8)t3StkOffLdFwData;
+ FwImgInfo.Data.Offset = t3StkOffLdFwDataAddr;
+ FwImgInfo.Data.Length = t3StkOffLdFwDataLen;
+ FwImgInfo.Sbss.Offset = t3StkOffLdFwSbssAddr;
+ FwImgInfo.Sbss.Length = t3StkOffLdFwSbssLen;
+ FwImgInfo.Bss.Offset = t3StkOffLdFwBssAddr;
+ FwImgInfo.Bss.Length = t3StkOffLdFwBssLen;
+ Cpu = T3_TX_CPU_ID;
+ }
+
+ if (LM_LoadFirmware(pDevice,
+ &FwImgInfo,
+ Cpu,
+ Cpu) != LM_STATUS_SUCCESS)
+ {
+ return LM_STATUS_FAILURE;
+ }
+
+ return LM_STATUS_SUCCESS;
+}
+
+#endif /* INCLUDE_TCP_SEG_SUPPORT */