qcacmn: Add sequence number to peer mlme object

The new P2P component cannot use legacy API's to get/set
the sequence number, thus we need new obj manager API's to handle
MLME sequence numbers.

Change-Id: I848f6c33f82cab6b90710f1411e0be55647e4476
CRs-Fixed: 2014032
Esse commit está contido em:
Vivek
2017-03-17 09:42:20 +05:30
commit de Sandeep Puligilla
commit 979a3f3e0b
3 arquivos alterados com 63 adições e 0 exclusões

Ver arquivo

@@ -38,6 +38,9 @@
/* Max length of a SSID */
#define WLAN_SSID_MAX_LEN 32
/* Max sequence number */
#define WLAN_MAX_SEQ_NUM 4096
/* Max no. of Stations can be associated to VDEV*/
#define WLAN_UMAC_MAX_AP_PEERS WLAN_UMAC_PSOC_MAX_PEERS
/* Max no. of peers for STA vap */

Ver arquivo

@@ -121,6 +121,7 @@ enum wlan_peer_state {
* @phymode: phy mode of station
* @rssi: Last received RSSI value
* @max_rate: Max Rate supported
* @seq_num: Sequence number
* @state: State of the peer
*/
struct wlan_objmgr_peer_mlme {
@@ -130,6 +131,7 @@ struct wlan_objmgr_peer_mlme {
enum wlan_phymode phymode;
int8_t rssi;
uint32_t max_rate;
uint16_t seq_num;
enum wlan_peer_state state;
};
@@ -746,4 +748,61 @@ static inline enum wlan_peer_state wlan_peer_mlme_get_state(
/* This API is invoked with lock acquired, do not add log prints */
return peer->peer_mlme.state;
}
/**
* wlan_peer_mlme_get_next_seq_num() - get peer mlme next sequence number
* @peer: PEER object
*
* API to get mlme peer next sequence number
*
* Caller need to acquire lock with wlan_peer_obj_lock()
*
* Return: peer mlme next sequence number
*/
static inline uint32_t wlan_peer_mlme_get_next_seq_num(
struct wlan_objmgr_peer *peer)
{
/* This API is invoked with lock acquired, do not add log prints */
if (peer->peer_mlme.seq_num < WLAN_MAX_SEQ_NUM)
peer->peer_mlme.seq_num++;
else
peer->peer_mlme.seq_num = 0;
return peer->peer_mlme.seq_num;
}
/**
* wlan_peer_mlme_get_seq_num() - get peer mlme sequence number
* @peer: PEER object
*
* API to get mlme peer sequence number
*
* Caller need to acquire lock with wlan_peer_obj_lock()
*
* Return: peer mlme sequence number
*/
static inline uint32_t wlan_peer_mlme_get_seq_num(
struct wlan_objmgr_peer *peer)
{
/* This API is invoked with lock acquired, do not add log prints */
return peer->peer_mlme.seq_num;
}
/**
* wlan_peer_mlme_reset_seq_num() - reset peer mlme sequence number
* @peer: PEER object
*
* API to reset peer sequence number
*
* Caller need to acquire lock with wlan_peer_obj_lock()
*
* Return: void
*/
static inline void wlan_peer_mlme_reset_seq_num(
struct wlan_objmgr_peer *peer)
{
/* This API is invoked with lock acquired, do not add log prints */
peer->peer_mlme.seq_num = 0;
}
#endif /* _WLAN_OBJMGR_PEER_OBJ_H_*/

Ver arquivo

@@ -143,6 +143,7 @@ struct wlan_objmgr_peer *wlan_objmgr_peer_obj_create(
wlan_peer_set_macaddr(peer, macaddr);
/* initialize peer state */
wlan_peer_mlme_set_state(peer, WLAN_INIT_STATE);
wlan_peer_mlme_reset_seq_num(peer);
qdf_atomic_init(&peer->peer_objmgr.ref_cnt);
/* Attach peer to psoc, psoc maintains the node table for the device */
if (wlan_objmgr_psoc_peer_attach(psoc, peer) !=