Skip to content
Snippets Groups Projects
Commit b040ddd6 authored by Xu, Liang's avatar Xu, Liang Committed by Kenneth Johansson
Browse files

Merge pull request #276 in SW_PON/linux from bugfix/DRVLIB_SW-395-gswip3.0 to xrx500

* commit 'b5fd84e062dfb008ef4eadbb3d638e3f2edf57fc':
  DRVLIB_SW-395-gswip3.0: Bug Fix for GSWIP 3.0 in GSW_MAC_TableClear and GSW_VLAN_PortMemberAdd
  DRVLIB_SW-395-gswip3.0: Fixed Alignment issue, and corrected few Api errors for GSWIP 3.0
  DRVLIB_SW-395: Missing Goto in GSWIP3.0
  DRVLIB_SW-395-gswip3.0: Multicast Table Entry Add Fix
  DRVLIB_SW-395-gswip3.0: BugFix for Mac table Entry Add for GSWIP 3.0
parent 2936ae49
Branches
No related tags found
No related merge requests found
...@@ -3153,15 +3153,15 @@ GSW_return_t GSW_MAC_TableClear(void *cdev) ...@@ -3153,15 +3153,15 @@ GSW_return_t GSW_MAC_TableClear(void *cdev)
ethsw_api_dev_t *gswdev = GSW_PDATA_GET(cdev); ethsw_api_dev_t *gswdev = GSW_PDATA_GET(cdev);
u32 ret; u32 ret;
   
#ifdef __KERNEL__
spin_lock_bh(&gswdev->lock_pce);
#endif
if (gswdev == NULL) { if (gswdev == NULL) {
pr_err("%s:%s:%d", __FILE__, __func__, __LINE__); pr_err("%s:%s:%d", __FILE__, __func__, __LINE__);
return GSW_statusErr; return GSW_statusErr;
} }
   
#ifdef __KERNEL__
spin_lock_bh(&gswdev->lock_pce);
#endif
/* Flush all entries from the MAC table */ /* Flush all entries from the MAC table */
gsw_w32(cdev, PCE_GCTRL_0_MTFL_OFFSET, gsw_w32(cdev, PCE_GCTRL_0_MTFL_OFFSET,
PCE_GCTRL_0_MTFL_SHIFT, PCE_GCTRL_0_MTFL_SHIFT,
...@@ -3244,10 +3244,10 @@ GSW_return_t GSW_MAC_TableEntryAdd(void *cdev, ...@@ -3244,10 +3244,10 @@ GSW_return_t GSW_MAC_TableEntryAdd(void *cdev,
   
if (gswdev->gipver == LTQ_GSWIP_3_0) { if (gswdev->gipver == LTQ_GSWIP_3_0) {
if ((parm->nPortId >= gswdev->tpnum) && if ((parm->nPortId >= gswdev->tpnum) &&
(!(parm->nPortId & 0x80000000))) (!(parm->nPortId & 0x80000000))) {
ret = GSW_statusErr; ret = GSW_statusErr;
goto UNLOCK_AND_RETURN;
goto UNLOCK_AND_RETURN; }
} }
   
memset(&tbl_prog, 0, sizeof(pctbl_prog_t)); memset(&tbl_prog, 0, sizeof(pctbl_prog_t));
...@@ -5574,8 +5574,10 @@ GSW_return_t GSW_VLAN_PortMemberAdd(void *cdev, ...@@ -5574,8 +5574,10 @@ GSW_return_t GSW_VLAN_PortMemberAdd(void *cdev,
goto UNLOCK_AND_RETURN; goto UNLOCK_AND_RETURN;
} }
   
if (pcindex >= 64) if (pcindex >= 64) {
return GSW_statusValueRange; ret = GSW_statusValueRange;
goto UNLOCK_AND_RETURN;
}
   
get_vlan_sw_table(cdev, pcindex, &avlantbl); get_vlan_sw_table(cdev, pcindex, &avlantbl);
   
...@@ -5762,6 +5764,7 @@ GSW_return_t GSW_VLAN_PortMemberRemove(void *cdev, ...@@ -5762,6 +5764,7 @@ GSW_return_t GSW_VLAN_PortMemberRemove(void *cdev,
if (pcindex == 0xFF) { if (pcindex == 0xFF) {
pr_err("This vid doesn't exists\n"); pr_err("This vid doesn't exists\n");
ret = GSW_statusErr; ret = GSW_statusErr;
goto UNLOCK_AND_RETURN;
} }
   
if (pcindex >= 64) { if (pcindex >= 64) {
...@@ -5831,6 +5834,7 @@ GSW_return_t GSW_VLAN_ReservedAdd(void *cdev, ...@@ -5831,6 +5834,7 @@ GSW_return_t GSW_VLAN_ReservedAdd(void *cdev,
pr_err("ERROR: %s:%s:%d,(VID:%d)\n", pr_err("ERROR: %s:%s:%d,(VID:%d)\n",
__FILE__, __func__, __LINE__, parm->nVId); __FILE__, __func__, __LINE__, parm->nVId);
ret = GSW_statusErr; ret = GSW_statusErr;
goto UNLOCK_AND_RETURN;
} }
   
memset(&pcetable, 0, sizeof(pctbl_prog_t)); memset(&pcetable, 0, sizeof(pctbl_prog_t));
...@@ -5921,6 +5925,7 @@ GSW_return_t GSW_VLAN_ReservedRemove(void *cdev, ...@@ -5921,6 +5925,7 @@ GSW_return_t GSW_VLAN_ReservedRemove(void *cdev,
pr_err("ERROR: %s:%s:%d,(VID:%d)\n", pr_err("ERROR: %s:%s:%d,(VID:%d)\n",
__FILE__, __func__, __LINE__, parm->nVId); __FILE__, __func__, __LINE__, parm->nVId);
ret = GSW_statusErr; ret = GSW_statusErr;
goto UNLOCK_AND_RETURN;
} }
   
memset(&pcetable, 0, sizeof(pctbl_prog_t)); memset(&pcetable, 0, sizeof(pctbl_prog_t));
...@@ -6567,7 +6572,7 @@ GSW_return_t GSW_QoS_SVLAN_ClassPCP_PortSet(void *cdev, ...@@ -6567,7 +6572,7 @@ GSW_return_t GSW_QoS_SVLAN_ClassPCP_PortSet(void *cdev,
   
if (gswdev == NULL) { if (gswdev == NULL) {
pr_err("%s:%s:%d", __FILE__, __func__, __LINE__); pr_err("%s:%s:%d", __FILE__, __func__, __LINE__);
ret = GSW_statusErr; return GSW_statusErr;
} }
   
#ifdef __KERNEL__ #ifdef __KERNEL__
...@@ -10925,10 +10930,10 @@ GSW_return_t GSW_MulticastTableEntryAdd(void *cdev, ...@@ -10925,10 +10930,10 @@ GSW_return_t GSW_MulticastTableEntryAdd(void *cdev,
#endif #endif
   
if (IS_VRSN_NOT_31(gswdev->gipver)) { if (IS_VRSN_NOT_31(gswdev->gipver)) {
if (parm->nPortId >= gswdev->tpnum) if (parm->nPortId >= gswdev->tpnum) {
ret = GSW_statusErr; ret = GSW_statusErr;
goto UNLOCK_AND_RETURN;
goto UNLOCK_AND_RETURN; }
} }
   
memset(&ptdata, 0, sizeof(pctbl_prog_t)); memset(&ptdata, 0, sizeof(pctbl_prog_t));
...@@ -11391,8 +11396,10 @@ GSW_return_t GSW_MulticastTableEntryRemove(void *cdev, ...@@ -11391,8 +11396,10 @@ GSW_return_t GSW_MulticastTableEntryRemove(void *cdev,
#endif #endif
   
if (IS_VRSN_NOT_31(gswdev->gipver)) { if (IS_VRSN_NOT_31(gswdev->gipver)) {
if (parm->nPortId >= gswdev->tpnum) if (parm->nPortId >= gswdev->tpnum) {
ret = GSW_statusErr; ret = GSW_statusErr;
goto UNLOCK_AND_RETURN;
}
} }
   
memset(&ptdata, 0, sizeof(pctbl_prog_t)); memset(&ptdata, 0, sizeof(pctbl_prog_t));
...@@ -20215,7 +20222,6 @@ GSW_return_t GSW_ExtendedVlanGet(void *cdev, GSW_EXTENDEDVLAN_config_t *parm) ...@@ -20215,7 +20222,6 @@ GSW_return_t GSW_ExtendedVlanGet(void *cdev, GSW_EXTENDEDVLAN_config_t *parm)
if (ret == GSW_statusErr) { if (ret == GSW_statusErr) {
pr_err("%s:%s:%d - GSW_QOS_Dscp2PcpTableGet", __FILE__, __func__, __LINE__); pr_err("%s:%s:%d - GSW_QOS_Dscp2PcpTableGet", __FILE__, __func__, __LINE__);
goto UNLOCK_AND_RETURN; goto UNLOCK_AND_RETURN;
;
} }
   
memcpy(parm->sTreatment.nDscp2PcpMap, dscp2pcp_get.nMap, (sizeof(u8) * 64)); memcpy(parm->sTreatment.nDscp2PcpMap, dscp2pcp_get.nMap, (sizeof(u8) * 64));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment