Search Linux Wireless

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/9/2021 4:06 AM, Sergey Ryazanov wrote:
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?
Yes, that is correct.

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);

Ricardo





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux