# Re: \[PATCH net-next v3 03/12\] net: wwan: t7xx: Add port proxy infrastructure

- From: Ilpo Järvinen \<ilpo.jarvinen@linux.intel.com\>
- Date: 2021-12-16 12:18:02 
- List: linux-wireless
- Page: https://ratatoskr.run/linux-wireless/2021/12/11219049
- Thread: https://ratatoskr.run/netdev/2021/12/11218124/t.md

```text
On Mon, 6 Dec 2021, Ricardo Martinez wrote:

> From: Haijun Liu <haijun.liu@mediatek.com>
> 
> Port-proxy provides a common interface to interact with different types
> of ports. Ports export their configuration via `struct t7xx_port` and
> operate as defined by `struct port_ops`.
> 
> Signed-off-by: Haijun Liu <haijun.liu@mediatek.com>
> Co-developed-by: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
> Signed-off-by: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
> Co-developed-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
> Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>


> +		status = FIELD_GET(HDR_FLD_CHN, le32_to_cpu(ccci_h->status));
> +		if (status == PORT_CH_STATUS_RX) {
> +			port->skb_handler(port, skb);

In the other callsite, port->skb_handler is checked for NULL but not here,
is it ok?

> +		if (md_state == MD_STATE_EXCEPTION && port_static->tx_ch != PORT_CH_MD_LOG_TX &&
> +		    port_static->tx_ch != PORT_CH_UART1_TX)
> +			return -ETXTBSY;

Here "TXT" = "text" (it seems unrelated to TX path).

> +#define MTK_MAX_QUEUE_NUM	16
> +#define MAX_RX_QUEUE_LENGTH	32
> +#define MAX_CTRL_QUEUE_LENGTH	16

MTK_QUEUES, RX_QUEUE_MAXLEN, CTRL_QUEUE_MAXLEN would be shorter and not
lose any of the meaning.

> +#define CLDMA_TXQ_MTU		MTK_SKB_4K
> +
> +struct port_proxy {
> +	int				port_number;
> +	struct t7xx_port_static		*ports_shared;
> +	struct t7xx_port		*ports_private;
> +	struct list_head		rx_ch_ports[PORT_CH_ID_MASK];

An off-by-one error in the array sizing?


-- 
 i.

```
