xref: /illumos-gate/usr/src/uts/common/io/qede/579xx/drivers/ecore/documentation/snippets/ptt.h (revision 14b24e2b79293068c8e016a69ef1d872fb5e2fd5)
1 /*
2  * @brief ecore_ptt_acquire - Allocate a PTT window
3  *
4  * Should be called at the entry point to the driver (at the beginning of an
5  * exported function)
6  *
7  * @param p_hwfn
8  *
9  * @return struct ecore_ptt
10  */
11 struct ecore_ptt *ecore_ptt_acquire(struct ecore_hwfn   *p_hwfn);
12 
13 /*
14  * @brief ecore_ptt_release - Release PTT Window
15  *
16  * Should be called at the end of a flow - at the end of the function that
17  * acquired the PTT.
18  *
19  * @param p_hwfn
20  * @param p_ptt
21  */
22 void ecore_ptt_release(struct ecore_hwfn    *p_hwfn,
23                struct ecore_ptt     *p_ptt);
24 
25 /*
26  * @brief ecore_wr - Write value to GRC BAR using the given ptt
27  *
28  * @param p_hwfn
29  * @param p_ptt
30  * @param val
31  * @param hw_addr
32  */
33 void ecore_wr(struct ecore_hwfn *p_hwfn,
34           struct ecore_ptt  *p_ptt,
35           u32       hw_addr,
36           u32       val);
37 
38 /*
39  * @brief ecore_rd - Read value to GRC BAR using the given ptt
40  *
41  * @param p_hwfn
42  * @param p_ptt
43  * @param val
44  * @param hw_addr
45  */
46 u32 ecore_rd(struct ecore_hwfn  *p_hwfn,
47          struct ecore_ptt   *p_ptt,
48          u32        hw_addr);
49 
50 /*
51  * @brief ecore_ptt_pretend - pretend to be another function
52  *        when accessing the ptt window
53  *
54  * @param p_hwfn
55  * @param p_ptt
56  * @param pretend
57  */
58 void ecore_ptt_pretend(struct ecore_hwfn    *p_hwfn,
59                struct ecore_ptt     *p_ptt,
60                struct pxp_pretend   pretend);
61