#include "lan743x_main.h"
 #include "lan743x_ethtool.h"
 
+static bool is_pci11x1x_chip(struct lan743x_adapter *adapter)
+{
+       struct lan743x_csr *csr = &adapter->csr;
+       u32 id_rev = csr->id_rev;
+
+       if (((id_rev & 0xFFFF0000) == ID_REV_ID_A011_) ||
+           ((id_rev & 0xFFFF0000) == ID_REV_ID_A041_)) {
+               return true;
+       }
+       return false;
+}
+
 static void lan743x_pci_cleanup(struct lan743x_adapter *adapter)
 {
        pci_release_selected_regions(adapter->pdev,
                }
        }
        if (int_sts & INT_BIT_ALL_TX_) {
-               for (channel = 0; channel < LAN743X_USED_TX_CHANNELS;
+               for (channel = 0; channel < adapter->used_tx_channels;
                        channel++) {
                        u32 int_bit = INT_BIT_DMA_TX_(channel);
 
 {
        struct msix_entry msix_entries[LAN743X_MAX_VECTOR_COUNT];
        struct lan743x_intr *intr = &adapter->intr;
+       unsigned int used_tx_channels;
        u32 int_vec_en_auto_clr = 0;
        u32 int_vec_map0 = 0;
        u32 int_vec_map1 = 0;
               sizeof(struct msix_entry) * LAN743X_MAX_VECTOR_COUNT);
        for (index = 0; index < LAN743X_MAX_VECTOR_COUNT; index++)
                msix_entries[index].entry = index;
+       used_tx_channels = adapter->used_tx_channels;
        ret = pci_enable_msix_range(adapter->pdev,
                                    msix_entries, 1,
-                                   1 + LAN743X_USED_TX_CHANNELS +
+                                   1 + used_tx_channels +
                                    LAN743X_USED_RX_CHANNELS);
 
        if (ret > 0) {
        if (intr->number_of_vectors > 1) {
                int number_of_tx_vectors = intr->number_of_vectors - 1;
 
-               if (number_of_tx_vectors > LAN743X_USED_TX_CHANNELS)
-                       number_of_tx_vectors = LAN743X_USED_TX_CHANNELS;
+               if (number_of_tx_vectors > used_tx_channels)
+                       number_of_tx_vectors = used_tx_channels;
                flags = LAN743X_VECTOR_FLAG_SOURCE_STATUS_READ |
                        LAN743X_VECTOR_FLAG_SOURCE_STATUS_W2C |
                        LAN743X_VECTOR_FLAG_SOURCE_ENABLE_CHECK |
                                                  INT_VEC_EN_(vector));
                }
        }
-       if ((intr->number_of_vectors - LAN743X_USED_TX_CHANNELS) > 1) {
+       if ((intr->number_of_vectors - used_tx_channels) > 1) {
                int number_of_rx_vectors = intr->number_of_vectors -
-                                          LAN743X_USED_TX_CHANNELS - 1;
+                                               used_tx_channels - 1;
 
                if (number_of_rx_vectors > LAN743X_USED_RX_CHANNELS)
                        number_of_rx_vectors = LAN743X_USED_RX_CHANNELS;
        struct lan743x_adapter *adapter = netdev_priv(netdev);
        int index;
 
-       lan743x_tx_close(&adapter->tx[0]);
+       for (index = 0; index < adapter->used_tx_channels; index++)
+               lan743x_tx_close(&adapter->tx[index]);
 
        for (index = 0; index < LAN743X_USED_RX_CHANNELS; index++)
                lan743x_rx_close(&adapter->rx[index]);
                        goto close_rx;
        }
 
-       ret = lan743x_tx_open(&adapter->tx[0]);
-       if (ret)
-               goto close_rx;
-
+       for (index = 0; index < adapter->used_tx_channels; index++) {
+               ret = lan743x_tx_open(&adapter->tx[index]);
+               if (ret)
+                       goto close_tx;
+       }
        return 0;
 
+close_tx:
+       for (index = 0; index < adapter->used_tx_channels; index++) {
+               if (adapter->tx[index].ring_cpu_ptr)
+                       lan743x_tx_close(&adapter->tx[index]);
+       }
+
 close_rx:
        for (index = 0; index < LAN743X_USED_RX_CHANNELS; index++) {
                if (adapter->rx[index].ring_cpu_ptr)
                                             struct net_device *netdev)
 {
        struct lan743x_adapter *adapter = netdev_priv(netdev);
+       u8 ch = 0;
+
+       if (adapter->is_pci11x1x)
+               ch = skb->queue_mapping % PCI11X1X_USED_TX_CHANNELS;
 
-       return lan743x_tx_xmit_frame(&adapter->tx[0], skb);
+       return lan743x_tx_xmit_frame(&adapter->tx[ch], skb);
 }
 
 static int lan743x_netdev_ioctl(struct net_device *netdev,
        int index;
        int ret;
 
+       adapter->is_pci11x1x = is_pci11x1x_chip(adapter);
+       if (adapter->is_pci11x1x) {
+               adapter->max_tx_channels = PCI11X1X_MAX_TX_CHANNELS;
+               adapter->used_tx_channels = PCI11X1X_USED_TX_CHANNELS;
+       } else {
+               adapter->max_tx_channels = LAN743X_MAX_TX_CHANNELS;
+               adapter->used_tx_channels = LAN743X_USED_TX_CHANNELS;
+       }
+
        adapter->intr.irq = adapter->pdev->irq;
        lan743x_csr_write(adapter, INT_EN_CLR, 0xFFFFFFFF);
 
                adapter->rx[index].channel_number = index;
        }
 
-       tx = &adapter->tx[0];
-       tx->adapter = adapter;
-       tx->channel_number = 0;
-       spin_lock_init(&tx->ring_lock);
+       for (index = 0; index < adapter->used_tx_channels; index++) {
+               tx = &adapter->tx[index];
+               tx->adapter = adapter;
+               tx->channel_number = index;
+               spin_lock_init(&tx->ring_lock);
+       }
+
        return 0;
 }
 
        struct net_device *netdev = NULL;
        int ret = -ENODEV;
 
-       netdev = devm_alloc_etherdev(&pdev->dev,
-                                    sizeof(struct lan743x_adapter));
+       if (id->device == PCI_DEVICE_ID_SMSC_A011 ||
+           id->device == PCI_DEVICE_ID_SMSC_A041) {
+               netdev = devm_alloc_etherdev_mqs(&pdev->dev,
+                                                sizeof(struct lan743x_adapter),
+                                                PCI11X1X_USED_TX_CHANNELS,
+                                                LAN743X_USED_RX_CHANNELS);
+       } else {
+               netdev = devm_alloc_etherdev(&pdev->dev,
+                                            sizeof(struct lan743x_adapter));
+       }
+
        if (!netdev)
                goto return_error;
 
 
 
 #define LAN743X_MAX_RX_CHANNELS                (4)
 #define LAN743X_MAX_TX_CHANNELS                (1)
+#define PCI11X1X_MAX_TX_CHANNELS       (4)
 struct lan743x_adapter;
 
 #define LAN743X_USED_RX_CHANNELS       (4)
 #define LAN743X_USED_TX_CHANNELS       (1)
+#define PCI11X1X_USED_TX_CHANNELS      (4)
 #define LAN743X_INT_MOD        (400)
 
 #if (LAN743X_USED_RX_CHANNELS > LAN743X_MAX_RX_CHANNELS)
 #if (LAN743X_USED_TX_CHANNELS > LAN743X_MAX_TX_CHANNELS)
 #error Invalid LAN743X_USED_TX_CHANNELS
 #endif
+#if (PCI11X1X_USED_TX_CHANNELS > PCI11X1X_MAX_TX_CHANNELS)
+#error Invalid PCI11X1X_USED_TX_CHANNELS
+#endif
 
 /* PCI */
 /* SMSC acquired EFAR late 1990's, MCHP acquired SMSC 2012 */
        u8                      mac_address[ETH_ALEN];
 
        struct lan743x_phy      phy;
-       struct lan743x_tx       tx[LAN743X_MAX_TX_CHANNELS];
-       struct lan743x_rx       rx[LAN743X_MAX_RX_CHANNELS];
+       struct lan743x_tx       tx[PCI11X1X_USED_TX_CHANNELS];
+       struct lan743x_rx       rx[LAN743X_USED_RX_CHANNELS];
+       bool                    is_pci11x1x;
+       u8                      max_tx_channels;
+       u8                      used_tx_channels;
 
 #define LAN743X_ADAPTER_FLAG_OTP               BIT(0)
        u32                     flags;