Search Linux Wireless

RE: [PATCH 15/50] wifi: ath12k: add dp_rx.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> +static int ath12k_get_ppdu_user_index(struct htt_ppdu_stats
>*ppdu_stats,
>> +                                   u16 peer_id) {
>> +     int i;
>> +
>> +     for (i = 0; i < HTT_PPDU_STATS_MAX_USERS - 1; i++) {
>> +             if (ppdu_stats->user_stats[i].is_valid_peer_id) {
>> +                     if (peer_id == ppdu_stats->user_stats[i].peer_id)
>> +                             return i;
>> +             } else {
>> +                     return i;
>> +             }
>
>is the user_stats[] array maintained in a manner where the
>"is_valid_peer_id" records are always at the beginning of the array?
>
>if not, then don't you have an issue if entry 0 has is_valid_peer_id = false
>and entry 1 has is_valid_peer_id = true and peer_id is matching since in that
>case you'd return 0 instead of 1?
That’s right. We use this function to get new ids starting from 0. So if an id is already
used (indicated by is_valid_peer_id) we move to the next id and return it and the
caller would set the is_valid_peer_id for that id and mark it.




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux