• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Broadcom Dongle Host Driver (DHD), CSI
3  *
4  * Copyright (C) 1999-2018, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions
16  * of the license of that module.  An independent module is a module which is
17  * not derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *      Notwithstanding the above, under no circumstances may you combine this
21  * software in any way with any other Broadcom software provided under a license
22  * other than the GPL, without Broadcom's express prior written consent.
23  *
24  * $Id: dhd_csi.h 558438 2015-05-22 06:05:11Z $
25  */
26 #ifndef __DHD_CSI_H__
27 #define __DHD_CSI_H__
28 
29 /* Maxinum csi file dump size */
30 #define MAX_CSI_FILESZ (32 * 1024)
31 /* Maxinum subcarrier number */
32 #define MAXINUM_CFR_DATA 256 * 4
33 #define CSI_DUMP_PATH "/sys/bcm-dhd/csi"
34 #define MAX_EVENT_SIZE 1400
35 /* maximun csi number stored at dhd */
36 #define MAX_CSI_NUM 8
37 
38 typedef struct cfr_dump_header {
39     /* 0 - successful; 1 - Failed */
40     uint8 status;
41     /* Peer MAC address */
42     uint8 peer_macaddr[6];
43     /* Number of Space Time Streams */
44     uint8 sts;
45     /* Number of RX chain */
46     uint8 num_rx;
47     /* Number of subcarrier */
48     uint16 num_carrier;
49     /* Length of the CSI dump */
50     uint32 cfr_dump_length;
51     /* remain unsend CSI data length */
52     uint32 remain_length;
53     /* RSSI */
54     int8 rssi;
55 } __attribute__((packed)) cfr_dump_header_t;
56 
57 typedef struct cfr_dump_data {
58     cfr_dump_header_t header;
59     uint32 data[MAXINUM_CFR_DATA];
60 } cfr_dump_data_t;
61 
62 typedef struct {
63     struct list_head list;
64     cfr_dump_data_t entry;
65 } cfr_dump_list_t;
66 
67 int dhd_csi_event_handler(dhd_pub_t *dhd, wl_event_msg_t *event,
68                           void *event_data);
69 
70 int dhd_csi_init(dhd_pub_t *dhd);
71 
72 int dhd_csi_deinit(dhd_pub_t *dhd);
73 
74 void dhd_csi_clean_list(dhd_pub_t *dhd);
75 
76 int dhd_csi_dump_list(dhd_pub_t *dhd, char *buf);
77 #endif /* __DHD_CSI_H__ */
78