1
2
3
4
5
6#ifndef _IPA_ENDPOINT_H_
7#define _IPA_ENDPOINT_H_
8
9#include <linux/types.h>
10#include <linux/workqueue.h>
11#include <linux/if_ether.h>
12
13#include "gsi.h"
14#include "ipa_reg.h"
15
16struct net_device;
17struct sk_buff;
18
19struct ipa;
20struct ipa_gsi_endpoint_data;
21
22
23#define IPA_AGGR_GRANULARITY 500
24
25#define IPA_MTU ETH_DATA_LEN
26
27enum ipa_endpoint_name {
28 IPA_ENDPOINT_AP_MODEM_TX,
29 IPA_ENDPOINT_MODEM_LAN_TX,
30 IPA_ENDPOINT_MODEM_COMMAND_TX,
31 IPA_ENDPOINT_AP_COMMAND_TX,
32 IPA_ENDPOINT_MODEM_AP_TX,
33 IPA_ENDPOINT_AP_LAN_RX,
34 IPA_ENDPOINT_AP_MODEM_RX,
35 IPA_ENDPOINT_MODEM_AP_RX,
36 IPA_ENDPOINT_MODEM_LAN_RX,
37 IPA_ENDPOINT_COUNT,
38};
39
40#define IPA_ENDPOINT_MAX 32
41
42
43
44
45
46
47struct ipa_endpoint {
48 struct ipa *ipa;
49 enum ipa_seq_type seq_type;
50 enum gsi_ee_id ee_id;
51 u32 channel_id;
52 u32 endpoint_id;
53 bool toward_ipa;
54 const struct ipa_endpoint_config_data *data;
55
56 u32 trans_tre_max;
57 u32 evt_ring_id;
58
59
60 struct net_device *netdev;
61
62
63 bool replenish_enabled;
64 u32 replenish_ready;
65 atomic_t replenish_saved;
66 atomic_t replenish_backlog;
67 struct delayed_work replenish_work;
68};
69
70void ipa_endpoint_modem_hol_block_clear_all(struct ipa *ipa);
71
72void ipa_endpoint_modem_pause_all(struct ipa *ipa, bool enable);
73
74int ipa_endpoint_modem_exception_reset_all(struct ipa *ipa);
75
76int ipa_endpoint_skb_tx(struct ipa_endpoint *endpoint, struct sk_buff *skb);
77
78void ipa_endpoint_exit_one(struct ipa_endpoint *endpoint);
79
80int ipa_endpoint_enable_one(struct ipa_endpoint *endpoint);
81void ipa_endpoint_disable_one(struct ipa_endpoint *endpoint);
82
83void ipa_endpoint_suspend_one(struct ipa_endpoint *endpoint);
84void ipa_endpoint_resume_one(struct ipa_endpoint *endpoint);
85
86void ipa_endpoint_suspend(struct ipa *ipa);
87void ipa_endpoint_resume(struct ipa *ipa);
88
89void ipa_endpoint_setup(struct ipa *ipa);
90void ipa_endpoint_teardown(struct ipa *ipa);
91
92int ipa_endpoint_config(struct ipa *ipa);
93void ipa_endpoint_deconfig(struct ipa *ipa);
94
95void ipa_endpoint_default_route_set(struct ipa *ipa, u32 endpoint_id);
96void ipa_endpoint_default_route_clear(struct ipa *ipa);
97
98u32 ipa_endpoint_init(struct ipa *ipa, u32 count,
99 const struct ipa_gsi_endpoint_data *data);
100void ipa_endpoint_exit(struct ipa *ipa);
101
102void ipa_endpoint_trans_complete(struct ipa_endpoint *ipa,
103 struct gsi_trans *trans);
104void ipa_endpoint_trans_release(struct ipa_endpoint *ipa,
105 struct gsi_trans *trans);
106
107#endif
108