Browse Source

qcacmn: Fix ME buf pool initialization

Free list created from ME buf pool expects next pointer to be first
element in the me buf. Change me buf structure to keep next pointer as
the first element. Also, Fix offsets in ME free list creation.

Change-Id: I2dffd0c04ba8514d0d1a5f5e6b14380902d1ec06
CRs-Fixed: 2077675
Kiran Venkatappa 7 years ago
parent
commit
a4cd297f84
2 changed files with 5 additions and 4 deletions
  1. 1 2
      dp/wifi3.0/dp_tx_me.c
  2. 4 2
      dp/wifi3.0/dp_types.h

+ 1 - 2
dp/wifi3.0/dp_tx_me.c

@@ -72,8 +72,7 @@ dp_tx_me_init(struct dp_pdev *pdev)
 		p = pdev->me_buf.freelist;
 		for (i = 0; i < num_pool_elems-1; i++) {
 			p->next = (struct dp_tx_me_buf_t *)
-				((char *)p + pdev->me_buf.size +
-				sizeof(struct dp_tx_me_buf_t));
+				((char *)p + pdev->me_buf.size);
 			p = p->next;
 		}
 		p->next = NULL;

+ 4 - 2
dp/wifi3.0/dp_types.h

@@ -1140,11 +1140,13 @@ struct dp_invalid_peer_msg {
 
 /*
  * dp_tx_me_buf_t: ME buffer
- * data: Destination Mac address
  * next: pointer to next buffer
+ * data: Destination Mac address
  */
 struct dp_tx_me_buf_t {
-	uint8_t data[DP_MAC_ADDR_LEN];
+	/* Note: ME buf pool initialization logic expects next pointer to
+	 * be the first element. Dont add anything before next */
 	struct dp_tx_me_buf_t *next;
+	uint8_t data[DP_MAC_ADDR_LEN];
 };
 #endif /* _DP_TYPES_H_ */