#define OUT
/*
-Function: PHSTransmit
-Description: This routine handle PHS(Payload Header Suppression for Tx path.
- It extracts a fragment of the NDIS_PACKET containing the header
- to be suppressed. It then suppresses the header by invoking PHS exported compress routine.
- The header data after suppression is copied back to the NDIS_PACKET.
-
-Input parameters: IN struct bcm_mini_adapter *Adapter - Miniport Adapter Context
- IN Packet - NDIS packet containing data to be transmitted
- IN USHORT Vcid - vcid pertaining to connection on which the packet is being sent.Used to
- identify PHS rule to be applied.
- B_UINT16 uiClassifierRuleID - Classifier Rule ID
- BOOLEAN bHeaderSuppressionEnabled - indicates if header suprression is enabled for SF.
-
-Return: STATUS_SUCCESS - If the send was successful.
- Other - If an error occurred.
-*/
+ * Function: PHSTransmit
+ * Description: This routine handle PHS(Payload Header Suppression for Tx path.
+ * It extracts a fragment of the NDIS_PACKET containing the header
+ * to be suppressed. It then suppresses the header by invoking PHS exported compress routine.
+ * The header data after suppression is copied back to the NDIS_PACKET.
+ *
+ * Input parameters: IN struct bcm_mini_adapter *Adapter - Miniport Adapter Context
+ * IN Packet - NDIS packet containing data to be transmitted
+ * IN USHORT Vcid - vcid pertaining to connection on which the packet is being sent.Used to
+ * identify PHS rule to be applied.
+ * B_UINT16 uiClassifierRuleID - Classifier Rule ID
+ * BOOLEAN bHeaderSuppressionEnabled - indicates if header suprression is enabled for SF.
+ *
+ * Return: STATUS_SUCCESS - If the send was successful.
+ * Other - If an error occurred.
+ */
int PHSTransmit(struct bcm_mini_adapter *Adapter,
struct sk_buff **pPacket,
UINT *PacketLen,
UCHAR bEthCSSupport)
{
- //PHS Sepcific
+ /* PHS Sepcific */
UINT unPHSPktHdrBytesCopied = 0;
UINT unPhsOldHdrSize = 0;
UINT unPHSNewPktHeaderLen = 0;
if (!bEthCSSupport)
BytesToRemove = ETH_HLEN;
/*
- Accumulate the header upto the size we support suppression
- from NDIS packet
- */
+ * Accumulate the header upto the size we support suppression
+ * from NDIS packet
+ */
usPacketType = ((struct ethhdr *)(Packet->data))->h_proto;
pucPHSPktHdrInBuf = Packet->data + BytesToRemove;
- //considering data after ethernet header
+ /* considering data after ethernet header */
if ((*PacketLen - BytesToRemove) < MAX_PHS_LENGTHS)
unPHSPktHdrBytesCopied = (*PacketLen - BytesToRemove);
else
if ((unPHSPktHdrBytesCopied > 0) &&
(unPHSPktHdrBytesCopied <= MAX_PHS_LENGTHS)) {
- // Step 2 Suppress Header using PHS and fill into intermediate ucaPHSPktHdrOutBuf.
- // Suppress only if IP Header and PHS Enabled For the Service Flow
+ /*
+ * Step 2 Suppress Header using PHS and fill into intermediate ucaPHSPktHdrOutBuf.
+ * Suppress only if IP Header and PHS Enabled For the Service Flow
+ */
if (((usPacketType == ETHERNET_FRAMETYPE_IPV4) ||
(usPacketType == ETHERNET_FRAMETYPE_IPV6)) &&
(bHeaderSuppressionEnabled)) {
return STATUS_SUCCESS;
} else {
- //if one byte headroom is not available, increase it through skb_cow
+ /* if one byte headroom is not available, increase it through skb_cow */
if (!(skb_headroom(Packet) > 0)) {
if (skb_cow(Packet, 1)) {
}
skb_push(Packet, 1);
- // CAUTION: The MAC Header is getting corrupted here for IP CS - can be saved by copying 14 Bytes. not needed .... hence corrupting it.
+ /*
+ * CAUTION: The MAC Header is getting corrupted
+ * here for IP CS - can be saved by copying 14
+ * Bytes. not needed .... hence corrupting it.
+ */
*(Packet->data + BytesToRemove) = bPHSI;
return STATUS_SUCCESS;
}
}
}
- //BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_SEND, DBG_LVL_ALL,"PHSTransmit : Dumping data packet After PHS");
+ /* BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_SEND, DBG_LVL_ALL,"PHSTransmit : Dumping data packet After PHS"); */
return STATUS_SUCCESS;
}
pucInBuff = packet->data;
- //Restore PHS suppressed header
+ /* Restore PHS suppressed header */
nStandardPktHdrLen = packet->len;
ulPhsStatus = PhsDeCompress(&Adapter->stBCMPhsContext,
usVcid,
BCM_DEBUG_PRINT_BUFFER(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, pBuf, nPktLen);
}
-//-----------------------------------------------------------------------------
-// Procedure: phs_init
-//
-// Description: This routine is responsible for allocating memory for classifier and
-// PHS rules.
-//
-// Arguments:
-// pPhsdeviceExtension - ptr to Device extension containing PHS Classifier rules and PHS Rules , RX, TX buffer etc
-//
-// Returns:
-// TRUE(1) -If allocation of memory was success full.
-// FALSE -If allocation of memory fails.
-//-----------------------------------------------------------------------------
+/*
+ * Procedure: phs_init
+ *
+ * Description: This routine is responsible for allocating memory for classifier and
+ * PHS rules.
+ *
+ * Arguments:
+ * pPhsdeviceExtension - ptr to Device extension containing PHS Classifier rules and PHS Rules , RX, TX buffer etc
+ *
+ * Returns:
+ * TRUE(1) -If allocation of memory was success full.
+ * FALSE -If allocation of memory fails.
+ */
int phs_init(struct bcm_phs_extension *pPhsdeviceExtension, struct bcm_mini_adapter *Adapter)
{
int i;
return 0;
}
-//PHS functions
-/*++
-PhsUpdateClassifierRule
-
-Routine Description:
- Exported function to add or modify a PHS Rule.
-
-Arguments:
- IN void* pvContext - PHS Driver Specific Context
- IN B_UINT16 uiVcid - The Service Flow ID for which the PHS rule applies
- IN B_UINT16 uiClsId - The Classifier ID within the Service Flow for which the PHS rule applies.
- IN struct bcm_phs_rule *psPhsRule - The PHS Rule strcuture to be added to the PHS Rule table.
-
-Return Value:
-
- 0 if successful,
- >0 Error.
-
---*/
+/*
+ * PHS functions
+ * PhsUpdateClassifierRule
+ *
+ * Routine Description:
+ * Exported function to add or modify a PHS Rule.
+ *
+ * Arguments:
+ * IN void* pvContext - PHS Driver Specific Context
+ * IN B_UINT16 uiVcid - The Service Flow ID for which the PHS rule applies
+ * IN B_UINT16 uiClsId - The Classifier ID within the Service Flow for which the PHS rule applies.
+ * IN struct bcm_phs_rule *psPhsRule - The PHS Rule strcuture to be added to the PHS Rule table.
+ *
+ * Return Value:
+ *
+ * 0 if successful,
+ * >0 Error.
+ */
ULONG PhsUpdateClassifierRule(IN void *pvContext,
IN B_UINT16 uiVcid ,
IN B_UINT16 uiClsId ,
return lStatus;
}
-/*++
-PhsDeletePHSRule
-
-Routine Description:
- Deletes the specified phs Rule within Vcid
-
-Arguments:
- IN void* pvContext - PHS Driver Specific Context
- IN B_UINT16 uiVcid - The Service Flow ID for which the PHS rule applies
- IN B_UINT8 u8PHSI - the PHS Index identifying PHS rule to be deleted.
-
-Return Value:
-
- 0 if successful,
- >0 Error.
-
---*/
-
+/*
+ * PhsDeletePHSRule
+ *
+ * Routine Description:
+ * Deletes the specified phs Rule within Vcid
+ *
+ * Arguments:
+ * IN void* pvContext - PHS Driver Specific Context
+ * IN B_UINT16 uiVcid - The Service Flow ID for which the PHS rule applies
+ * IN B_UINT8 u8PHSI - the PHS Index identifying PHS rule to be deleted.
+ *
+ * Return Value:
+ *
+ * 0 if successful,
+ * >0 Error.
+ */
ULONG PhsDeletePHSRule(IN void *pvContext, IN B_UINT16 uiVcid, IN B_UINT8 u8PHSI)
{
ULONG lStatus = 0;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL, "======>\n");
if (pDeviceExtension) {
- //Retrieve the SFID Entry Index for requested Service Flow
+ /* Retrieve the SFID Entry Index for requested Service Flow */
nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, uiVcid, &pstServiceFlowEntry);
if (nSFIndex == PHS_INVALID_TABLE_INDEX) {
return lStatus;
}
-/*++
-PhsDeleteClassifierRule
-
-Routine Description:
- Exported function to Delete a PHS Rule for the SFID,CLSID Pair.
-
-Arguments:
- IN void* pvContext - PHS Driver Specific Context
- IN B_UINT16 uiVcid - The Service Flow ID for which the PHS rule applies
- IN B_UINT16 uiClsId - The Classifier ID within the Service Flow for which the PHS rule applies.
-
-Return Value:
-
- 0 if successful,
- >0 Error.
-
---*/
+/*
+ * PhsDeleteClassifierRule
+ *
+ * Routine Description:
+ * Exported function to Delete a PHS Rule for the SFID,CLSID Pair.
+ *
+ * Arguments:
+ * IN void* pvContext - PHS Driver Specific Context
+ * IN B_UINT16 uiVcid - The Service Flow ID for which the PHS rule applies
+ * IN B_UINT16 uiClsId - The Classifier ID within the Service Flow for which the PHS rule applies.
+ *
+ * Return Value:
+ *
+ * 0 if successful,
+ * >0 Error.
+ */
ULONG PhsDeleteClassifierRule(IN void *pvContext, IN B_UINT16 uiVcid, IN B_UINT16 uiClsId)
{
ULONG lStatus = 0;
struct bcm_phs_extension *pDeviceExtension = (struct bcm_phs_extension *)pvContext;
if (pDeviceExtension) {
- //Retrieve the SFID Entry Index for requested Service Flow
+ /* Retrieve the SFID Entry Index for requested Service Flow */
nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, uiVcid, &pstServiceFlowEntry);
if (nSFIndex == PHS_INVALID_TABLE_INDEX) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL, "SFID Match Failed\n");
return lStatus;
}
-/*++
-PhsDeleteSFRules
-
-Routine Description:
- Exported function to Delete a all PHS Rules for the SFID.
-
-Arguments:
- IN void* pvContext - PHS Driver Specific Context
- IN B_UINT16 uiVcid - The Service Flow ID for which the PHS rules need to be deleted
-
-Return Value:
-
- 0 if successful,
- >0 Error.
-
---*/
+/*
+ * PhsDeleteSFRules
+ *
+ * Routine Description:
+ * Exported function to Delete a all PHS Rules for the SFID.
+ *
+ * Arguments:
+ * IN void* pvContext - PHS Driver Specific Context
+ * IN B_UINT16 uiVcid - The Service Flow ID for which the PHS rules need to be deleted
+ *
+ * Return Value:
+ *
+ * 0 if successful,
+ * >0 Error.
+ */
ULONG PhsDeleteSFRules(IN void *pvContext, IN B_UINT16 uiVcid)
{
ULONG lStatus = 0;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL, "====>\n");
if (pDeviceExtension) {
- //Retrieve the SFID Entry Index for requested Service Flow
+ /* Retrieve the SFID Entry Index for requested Service Flow */
nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable,
uiVcid, &pstServiceFlowEntry);
if (nSFIndex == PHS_INVALID_TABLE_INDEX) {
return lStatus;
}
-/*++
-PhsCompress
-
-Routine Description:
- Exported function to compress the data using PHS.
-
-Arguments:
- IN void* pvContext - PHS Driver Specific Context.
- IN B_UINT16 uiVcid - The Service Flow ID to which current packet header compression applies.
- IN UINT uiClsId - The Classifier ID to which current packet header compression applies.
- IN void *pvInputBuffer - The Input buffer containg packet header data
- IN void *pvOutputBuffer - The output buffer returned by this function after PHS
- IN UINT *pOldHeaderSize - The actual size of the header before PHS
- IN UINT *pNewHeaderSize - The new size of the header after applying PHS
-
-Return Value:
-
- 0 if successful,
- >0 Error.
-
---*/
+/*
+ * PhsCompress
+ *
+ * Routine Description:
+ * Exported function to compress the data using PHS.
+ *
+ * Arguments:
+ * IN void* pvContext - PHS Driver Specific Context.
+ * IN B_UINT16 uiVcid - The Service Flow ID to which current packet header compression applies.
+ * IN UINT uiClsId - The Classifier ID to which current packet header compression applies.
+ * IN void *pvInputBuffer - The Input buffer containg packet header data
+ * IN void *pvOutputBuffer - The output buffer returned by this function after PHS
+ * IN UINT *pOldHeaderSize - The actual size of the header before PHS
+ * IN UINT *pNewHeaderSize - The new size of the header after applying PHS
+ *
+ * Return Value:
+ *
+ * 0 if successful,
+ * >0 Error.
+ */
ULONG PhsCompress(IN void *pvContext,
IN B_UINT16 uiVcid,
IN B_UINT16 uiClsId,
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_SEND, DBG_LVL_ALL, "Suppressing header\n");
- //Retrieve the SFID Entry Index for requested Service Flow
+ /* Retrieve the SFID Entry Index for requested Service Flow */
nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable,
uiVcid, &pstServiceFlowEntry);
if (nSFIndex == PHS_INVALID_TABLE_INDEX) {
return lStatus;
}
- //get rule from SF id,Cls ID pair and proceed
+ /* get rule from SF id,Cls ID pair and proceed */
pstPhsRule = pstClassifierEntry->pstPhsRule;
if (!ValidatePHSRuleComplete(pstPhsRule)) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL, "PHS Rule Defined For Classifier But Not Complete\n");
return lStatus;
}
- //Compress Packet
+ /* Compress Packet */
lStatus = phs_compress(pstPhsRule, (PUCHAR)pvInputBuffer,
(PUCHAR)pvOutputBuffer, pOldHeaderSize, pNewHeaderSize);
return lStatus;
}
-/*++
-PhsDeCompress
-
-Routine Description:
- Exported function to restore the packet header in Rx path.
-
-Arguments:
- IN void* pvContext - PHS Driver Specific Context.
- IN B_UINT16 uiVcid - The Service Flow ID to which current packet header restoration applies.
- IN void *pvInputBuffer - The Input buffer containg suppressed packet header data
- OUT void *pvOutputBuffer - The output buffer returned by this function after restoration
- OUT UINT *pHeaderSize - The packet header size after restoration is returned in this parameter.
-
-Return Value:
-
- 0 if successful,
- >0 Error.
-
---*/
+/*
+ * PhsDeCompress
+ *
+ * Routine Description:
+ * Exported function to restore the packet header in Rx path.
+ *
+ * Arguments:
+ * IN void* pvContext - PHS Driver Specific Context.
+ * IN B_UINT16 uiVcid - The Service Flow ID to which current packet header restoration applies.
+ * IN void *pvInputBuffer - The Input buffer containg suppressed packet header data
+ * OUT void *pvOutputBuffer - The output buffer returned by this function after restoration
+ * OUT UINT *pHeaderSize - The packet header size after restoration is returned in this parameter.
+ *
+ * Return Value:
+ *
+ * 0 if successful,
+ * >0 Error.
+ */
ULONG PhsDeCompress(IN void *pvContext,
IN B_UINT16 uiVcid,
IN void *pvInputBuffer,
if (phsi == UNCOMPRESSED_PACKET)
return STATUS_PHS_NOCOMPRESSION;
- //Retrieve the SFID Entry Index for requested Service Flow
+ /* Retrieve the SFID Entry Index for requested Service Flow */
nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable,
uiVcid, &pstServiceFlowEntry);
if (nSFIndex == PHS_INVALID_TABLE_INDEX) {
nPhsRuleIndex = GetPhsRuleEntry(pstServiceFlowEntry->pstClassifierTable, phsi,
eActiveClassifierRuleContext, &pstPhsRule);
if (nPhsRuleIndex == PHS_INVALID_TABLE_INDEX) {
- //Phs Rule does not exist in active rules table. Lets try in the old rules table.
+ /* Phs Rule does not exist in active rules table. Lets try in the old rules table. */
nPhsRuleIndex = GetPhsRuleEntry(pstServiceFlowEntry->pstClassifierTable,
phsi, eOldClassifierRuleContext, &pstPhsRule);
if (nPhsRuleIndex == PHS_INVALID_TABLE_INDEX)
return STATUS_PHS_COMPRESSED;
}
-//-----------------------------------------------------------------------------
-// Procedure: free_phs_serviceflow_rules
-//
-// Description: This routine is responsible for freeing memory allocated for PHS rules.
-//
-// Arguments:
-// rules - ptr to S_SERVICEFLOW_TABLE structure.
-//
-// Returns:
-// Does not return any value.
-//-----------------------------------------------------------------------------
-
+/*
+ * Procedure: free_phs_serviceflow_rules
+ *
+ * Description: This routine is responsible for freeing memory allocated for PHS rules.
+ *
+ * Arguments:
+ * rules - ptr to S_SERVICEFLOW_TABLE structure.
+ *
+ * Returns:
+ * Does not return any value.
+ */
static void free_phs_serviceflow_rules(struct bcm_phs_table *psServiceFlowRulesTable)
{
int i, j;
{
if (psPhsRule) {
if (!psPhsRule->u8PHSI) {
- // PHSI is not valid
+ /* PHSI is not valid */
return FALSE;
}
if (!psPhsRule->u8PHSS) {
- //PHSS Is Undefined
+ /* PHSS Is Undefined */
return FALSE;
}
- //Check if PHSF is defines for the PHS Rule
- if (!psPhsRule->u8PHSFLength) // If any part of PHSF is valid then Rule contains valid PHSF
+ /* Check if PHSF is defines for the PHS Rule */
+ if (!psPhsRule->u8PHSFLength) /* If any part of PHSF is valid then Rule contains valid PHSF */
return FALSE;
return TRUE;
int iSfIndex;
BOOLEAN bFreeEntryFound = FALSE;
- //Check for a free entry in SFID table
+ /* Check for a free entry in SFID table */
for (iSfIndex = 0; iSfIndex < MAX_SERVICEFLOWS; iSfIndex++) {
if (!psServiceFlowTable->stSFList[iSfIndex].bUsed) {
bFreeEntryFound = TRUE;
uiStatus = CreateClassifierPHSRule(uiClsId, psaClassifiertable, psPhsRule,
eActiveClassifierRuleContext, u8AssociatedPHSI);
if (uiStatus == PHS_SUCCESS) {
- //Add entry at free index to the SF
+ /* Add entry at free index to the SF */
psServiceFlowTable->stSFList[iSfIndex].bUsed = TRUE;
psServiceFlowTable->stSFList[iSfIndex].uiVcid = uiVcid;
}
if (nClassifierIndex == PHS_INVALID_TABLE_INDEX) {
/*
- The Classifier doesn't exist. So its a new classifier being added.
- Add new entry to associate PHS Rule to the Classifier
- */
+ * The Classifier doesn't exist. So its a new classifier being added.
+ * Add new entry to associate PHS Rule to the Classifier
+ */
uiStatus = CreateClassifierPHSRule(uiClsId, psaClassifiertable,
psPhsRule,
}
/*
- The Classifier exists.The PHS Rule for this classifier
- is being modified
- */
+ * The Classifier exists.The PHS Rule for this classifier
+ * is being modified
+ */
if (pstClassifierEntry->u8PHSI == psPhsRule->u8PHSI) {
if (pstClassifierEntry->pstPhsRule == NULL)
return ERR_PHS_INVALID_PHS_RULE;
/*
- This rule already exists if any fields are changed for this PHS
- rule update them.
- */
+ * This rule already exists if any fields are changed for this PHS
+ * rule update them.
+ */
/* If any part of PHSF is valid then we update PHSF */
if (psPhsRule->u8PHSFLength) {
- //update PHSF
+ /* update PHSF */
memcpy(pstClassifierEntry->pstPhsRule->u8PHSF,
psPhsRule->u8PHSF, MAX_PHS_LENGTHS);
}
if (psPhsRule->u8PHSFLength) {
- //update PHSFLen
+ /* update PHSFLen */
pstClassifierEntry->pstPhsRule->u8PHSFLength = psPhsRule->u8PHSFLength;
}
if (psPhsRule->u8PHSMLength) {
- //update PHSM
+ /* update PHSM */
memcpy(pstClassifierEntry->pstPhsRule->u8PHSM,
psPhsRule->u8PHSM, MAX_PHS_LENGTHS);
}
if (psPhsRule->u8PHSMLength) {
- //update PHSM Len
+ /* update PHSM Len */
pstClassifierEntry->pstPhsRule->u8PHSMLength =
psPhsRule->u8PHSMLength;
}
if (psPhsRule->u8PHSS) {
- //update PHSS
+ /* update PHSS */
pstClassifierEntry->pstPhsRule->u8PHSS = psPhsRule->u8PHSS;
}
- //update PHSV
+ /* update PHSV */
pstClassifierEntry->pstPhsRule->u8PHSV = psPhsRule->u8PHSV;
} else {
- /*
- A new rule is being set for this classifier.
- */
+ /* A new rule is being set for this classifier. */
uiStatus = UpdateClassifierPHSRule(uiClsId, pstClassifierEntry,
psaClassifiertable, psPhsRule, u8AssociatedPHSI);
}
return ERR_INVALID_CLASSIFIERTABLE_FOR_SF;
if (eClsContext == eOldClassifierRuleContext) {
- /* If An Old Entry for this classifier ID already exists in the
- old rules table replace it. */
+ /*
+ * If An Old Entry for this classifier ID already exists in the
+ * old rules table replace it.
+ */
iClassifierIndex =
GetClassifierEntry(psaClassifiertable, uiClsId,
if (iClassifierIndex != PHS_INVALID_TABLE_INDEX) {
/*
- The Classifier already exists in the old rules table
- Lets replace the old classifier with the new one.
- */
+ * The Classifier already exists in the old rules table
+ * Lets replace the old classifier with the new one.
+ */
bFreeEntryFound = TRUE;
}
}
if (!bFreeEntryFound) {
- /*
- Continue to search for a free location to add the rule
- */
+ /* Continue to search for a free location to add the rule */
for (iClassifierIndex = 0; iClassifierIndex <
MAX_PHSRULE_PER_SF; iClassifierIndex++) {
if (eClsContext == eActiveClassifierRuleContext)
if (eClsContext == eActiveClassifierRuleContext)
return ERR_CLSASSIFIER_TABLE_FULL;
else {
- //Lets replace the oldest rule if we are looking in old Rule table
+ /* Lets replace the oldest rule if we are looking in old Rule table */
if (psaClassifiertable->uiOldestPhsRuleIndex >= MAX_PHSRULE_PER_SF)
psaClassifiertable->uiOldestPhsRuleIndex = 0;
psPhsRule->u8RefCnt = 0;
- /* Step 1 Deref Any Exisiting PHS Rule in this classifier Entry*/
+ /* Step 1 Deref Any Exisiting PHS Rule in this classifier Entry */
bPHSRuleOrphaned = DerefPhsRule(uiClsId, psaClassifiertable,
pstClassifierEntry->pstPhsRule);
- //Step 2 Search if there is a PHS Rule with u8AssociatedPHSI in Classifier table for this SF
+ /* Step 2 Search if there is a PHS Rule with u8AssociatedPHSI in Classifier table for this SF */
nPhsRuleIndex = GetPhsRuleEntry(psaClassifiertable, u8AssociatedPHSI,
eActiveClassifierRuleContext, &pstAddPhsRule);
if (PHS_INVALID_TABLE_INDEX == nPhsRuleIndex) {
return ERR_PHS_INVALID_PHS_RULE;
}
- //Step 2.a PHS Rule Does Not Exist .Create New PHS Rule for uiClsId
+ /* Step 2.a PHS Rule Does Not Exist .Create New PHS Rule for uiClsId */
if (FALSE == bPHSRuleOrphaned) {
pstClassifierEntry->pstPhsRule = kmalloc(sizeof(struct bcm_phs_rule), GFP_KERNEL);
}
memcpy(pstClassifierEntry->pstPhsRule, psPhsRule, sizeof(struct bcm_phs_rule));
} else {
- //Step 2.b PHS Rule Exists Tie uiClsId with the existing PHS Rule
+ /* Step 2.b PHS Rule Exists Tie uiClsId with the existing PHS Rule */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL, "\nTying Classifier to Existing PHS Rule");
if (bPHSRuleOrphaned) {
kfree(pstClassifierEntry->pstPhsRule);
pstPhsRule->u8RefCnt--;
if (0 == pstPhsRule->u8RefCnt) {
- /*if(pstPhsRule->u8PHSI)
- //Store the currently active rule into the old rules list
- CreateClassifierPHSRule(uiClsId,psaClassifiertable,pstPhsRule,eOldClassifierRuleContext,pstPhsRule->u8PHSI);*/
+ /*
+ * if(pstPhsRule->u8PHSI)
+ * Store the currently active rule into the old rules list
+ * CreateClassifierPHSRule(uiClsId,psaClassifiertable,pstPhsRule,eOldClassifierRuleContext,pstPhsRule->u8PHSI);
+ */
return TRUE;
} else
return FALSE;
}
}
-//-----------------------------------------------------------------------------
-// Procedure: phs_decompress
-//
-// Description: This routine restores the static fields within the packet.
-//
-// Arguments:
-// in_buf - ptr to incoming packet buffer.
-// out_buf - ptr to output buffer where the suppressed header is copied.
-// decomp_phs_rules - ptr to PHS rule.
-// header_size - ptr to field which holds the phss or phsf_length.
-//
-// Returns:
-// size -The number of bytes of dynamic fields present with in the incoming packet
-// header.
-// 0 -If PHS rule is NULL.If PHSI is 0 indicateing packet as uncompressed.
-//-----------------------------------------------------------------------------
-
+/*
+ * Procedure: phs_decompress
+ *
+ * Description: This routine restores the static fields within the packet.
+ *
+ * Arguments:
+ * in_buf - ptr to incoming packet buffer.
+ * out_buf - ptr to output buffer where the suppressed header is copied.
+ * decomp_phs_rules - ptr to PHS rule.
+ * header_size - ptr to field which holds the phss or phsf_length.
+ *
+ * Returns:
+ * size -The number of bytes of dynamic fields present with in the incoming packet
+ * header.
+ * 0 -If PHS rule is NULL.If PHSI is 0 indicateing packet as uncompressed.
+ */
int phs_decompress(unsigned char *in_buf,
unsigned char *out_buf,
struct bcm_phs_rule *decomp_phs_rules,
return 0;
tmp_memb = decomp_phs_rules;
- //BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_RECEIVE,DBG_LVL_ALL,"\nDECOMP:In phs_decompress PHSI 1 %d",phsi));
- //*header_size = tmp_memb->u8PHSFLength;
+ /*
+ * BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_RECEIVE,DBG_LVL_ALL,"\nDECOMP:In phs_decompress PHSI 1 %d",phsi));
+ * header_size = tmp_memb->u8PHSFLength;
+ */
phss = tmp_memb->u8PHSS;
phsf = tmp_memb->u8PHSF;
phsm = tmp_memb->u8PHSM;
if (phss > MAX_PHS_LENGTHS)
phss = MAX_PHS_LENGTHS;
- //BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_RECEIVE,DBG_LVL_ALL,"\nDECOMP:In phs_decompress PHSI %d phss %d index %d",phsi,phss,index));
+ /*
+ * BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_RECEIVE,DBG_LVL_ALL,"\nDECOMP:
+ * In phs_decompress PHSI %d phss %d index %d",phsi,phss,index));
+ */
while ((phss > 0) && (size < in_buf_len)) {
bit = ((*phsm << i) & SUPPRESS);
return size;
}
-//-----------------------------------------------------------------------------
-// Procedure: phs_compress
-//
-// Description: This routine suppresses the static fields within the packet.Before
-// that it will verify the fields to be suppressed with the corresponding fields in the
-// phsf. For verification it checks the phsv field of PHS rule. If set and verification
-// succeeds it suppresses the field.If any one static field is found different none of
-// the static fields are suppressed then the packet is sent as uncompressed packet with
-// phsi=0.
-//
-// Arguments:
-// phs_rule - ptr to PHS rule.
-// in_buf - ptr to incoming packet buffer.
-// out_buf - ptr to output buffer where the suppressed header is copied.
-// header_size - ptr to field which holds the phss.
-//
-// Returns:
-// size-The number of bytes copied into the output buffer i.e dynamic fields
-// 0 -If PHS rule is NULL.If PHSV field is not set.If the verification fails.
-//-----------------------------------------------------------------------------
+/*
+ * Procedure: phs_compress
+ *
+ * Description: This routine suppresses the static fields within the packet.Before
+ * that it will verify the fields to be suppressed with the corresponding fields in the
+ * phsf. For verification it checks the phsv field of PHS rule. If set and verification
+ * succeeds it suppresses the field.If any one static field is found different none of
+ * the static fields are suppressed then the packet is sent as uncompressed packet with
+ * phsi=0.
+ *
+ * Arguments:
+ * phs_rule - ptr to PHS rule.
+ * in_buf - ptr to incoming packet buffer.
+ * out_buf - ptr to output buffer where the suppressed header is copied.
+ * header_size - ptr to field which holds the phss.
+ *
+ * Returns:
+ * size-The number of bytes copied into the output buffer i.e dynamic fields
+ * 0 -If PHS rule is NULL.If PHSV field is not set.If the verification fails.
+ */
static int phs_compress(struct bcm_phs_rule *phs_rule,
unsigned char *in_buf,
unsigned char *out_buf,
else
*header_size = *new_header_size;
- //To copy PHSI
+ /* To copy PHSI */
out_buf++;
suppress = verify_suppress_phsf(in_buf, out_buf, phs_rule->u8PHSF,
phs_rule->u8PHSM, phs_rule->u8PHSS,
return suppress;
}
-//-----------------------------------------------------------------------------
-// Procedure: verify_suppress_phsf
-//
-// Description: This routine verifies the fields of the packet and if all the
-// static fields are equal it adds the phsi of that PHS rule.If any static
-// field differs it woun't suppress any field.
-//
-// Arguments:
-// rules_set - ptr to classifier_rules.
-// in_buffer - ptr to incoming packet buffer.
-// out_buffer - ptr to output buffer where the suppressed header is copied.
-// phsf - ptr to phsf.
-// phsm - ptr to phsm.
-// phss - variable holding phss.
-//
-// Returns:
-// size-The number of bytes copied into the output buffer i.e dynamic fields.
-// 0 -Packet has failed the verification.
-//-----------------------------------------------------------------------------
-
+/*
+ * Procedure: verify_suppress_phsf
+ *
+ * Description: This routine verifies the fields of the packet and if all the
+ * static fields are equal it adds the phsi of that PHS rule.If any static
+ * field differs it woun't suppress any field.
+ *
+ * Arguments:
+ * rules_set - ptr to classifier_rules.
+ * in_buffer - ptr to incoming packet buffer.
+ * out_buffer - ptr to output buffer where the suppressed header is copied.
+ * phsf - ptr to phsf.
+ * phsm - ptr to phsm.
+ * phss - variable holding phss.
+ *
+ * Returns:
+ * size-The number of bytes copied into the output buffer i.e dynamic fields.
+ * 0 -Packet has failed the verification.
+ */
static int verify_suppress_phsf(unsigned char *in_buffer,
unsigned char *out_buffer,
unsigned char *phsf,