Thread (43 messages) 43 messages, 4 authors, 2022-01-12

Re: [PATCH v2 06/14] net: wwan: t7xx: Add AT and MBIM WWAN ports

From: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Date: 2021-11-09 12:06:40
Also in: linux-wireless

On Mon, Nov 1, 2021 at 6:57 AM Ricardo Martinez wrote:
...
 static struct t7xx_port md_ccci_ports[] = {
+       {CCCI_UART2_TX, CCCI_UART2_RX, DATA_AT_CMD_Q, DATA_AT_CMD_Q, 0xff,
+        0xff, ID_CLDMA1, PORT_F_RX_CHAR_NODE, &wwan_sub_port_ops, 0, "ttyC0", WWAN_PORT_AT},
+       {CCCI_MBIM_TX, CCCI_MBIM_RX, 2, 2, 0, 0, ID_CLDMA1,
+        PORT_F_RX_CHAR_NODE, &wwan_sub_port_ops, 10, "ttyCMBIM0", WWAN_PORT_MBIM},
...
+               if (count + CCCI_H_ELEN > txq_mtu &&
+                   (port_ccci->tx_ch == CCCI_MBIM_TX ||
+                    (port_ccci->tx_ch >= CCCI_DSS0_TX && port_ccci->tx_ch <= CCCI_DSS7_TX)))
+                       multi_packet = DIV_ROUND_UP(count, txq_mtu - CCCI_H_ELEN);
I am just wondering, the chip does support MBIM message fragmentation,
but does not support AT commands stream (CCCI_UART2_TX) fragmentation.
Is that the correct conclusion from the code above?

BTW, you could factor out data fragmentation support to a dedicated
function to improve code readability. Something like this:

static inline bool port_is_multipacket_capable(... *port)
{
        return port->tx_ch == CCCI_MBIM_TX ||
               (port->tx_ch >= CCCI_DSS0_TX && port->tx_ch <= CCCI_DSS7_TX);
}

So condition become something like that:

        if (count + CCCI_H_ELEN > txq_mtu &&
            port_is_multipacket_capable(port))
                multi_packet = DIV_ROUND_UP(count, txq_mtu - CCCI_H_ELEN);

-- 
Sergey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help