<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NRF7002 using one virtual interface breaks a different one</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114754/nrf7002-using-one-virtual-interface-breaks-a-different-one</link><description>I am trying to use second virtual interface of NRF7002 to use with custom linux driver. I intended to use it to add support of STA+AP or STA+STA mode. However, I observing strange behaviour even if use only one virtual interface at time. 
 For example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Sep 2024 08:01:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114754/nrf7002-using-one-virtual-interface-breaks-a-different-one" /><item><title>RE: NRF7002 using one virtual interface breaks a different one</title><link>https://devzone.nordicsemi.com/thread/502704?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2024 08:01:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53af22c6-7045-4ae7-a046-a77213a84b08</guid><dc:creator>SpeedCrash100</dc:creator><description>&lt;p&gt;Apparently, the original example driver has a flaw:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;netdev_tx_t nrf_wifi_netdev_start_xmit(struct sk_buff *skb,
                       struct net_device *netdev)
{
    // Removed for brevity...
    fmac_dev_ctx = rpu_ctx_lnx-&amp;gt;rpu_ctx;
    def_dev_ctx = wifi_dev_priv(fmac_dev_ctx);
    host_stats = &amp;amp;def_dev_ctx-&amp;gt;host_stats;

    // Removed for brevity...

    if ((vif_ctx_lnx-&amp;gt;num_tx_pkt - host_stats-&amp;gt;total_tx_pkts) &amp;gt;=
        CONFIG_NRF700X_MAX_TX_PENDING_QLEN) {
        if (!netif_queue_stopped(netdev)) {
            netif_stop_queue(netdev);
        }
        schedule_work(&amp;amp;vif_ctx_lnx-&amp;gt;ws_queue_monitor);
    }

    // Removed for brevity...

    vif_ctx_lnx-&amp;gt;num_tx_pkt++;
    schedule_work(&amp;amp;vif_ctx_lnx-&amp;gt;ws_data_tx);

out:
    return ret;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;With second interface it seems that packet divided into parts and total_tx_pkts becomes bigger than num_tx_pkt the linux driver count. It creates integer underflow because both of them are unsigned and stops the queue forever.&lt;/p&gt;
&lt;p&gt;As a workaround I will use the difference: `host_stats-&amp;gt;total_tx_pkts - host_stats-&amp;gt;total_tx_done_pkts`&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>