Commit 1ebab783 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'mhi-for-v6.11' of...

Merge tag 'mhi-for-v6.11' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-next

Manivannan writes:

MHI Host
========

- Used unique 'mhi_pci_dev_info' struct for product families instead of reusing
  a shared struct. This allows displaying the actual product name for the MHI
  devices during driver probe.

- Added support for Foxconn SDX72 based modems, T99W515 and DW5934E.

- Added a 'name' field to 'struct mhi_controller' for allowing the MHI client
  drivers to uniquely identify each MHI device based on its product/device name.
  This is useful in applying any device specific quirks in the client drivers.

WWAN MHI Client driver
======================

- Due to the build dependency with the MHI patch exposing 'name' field to client
  drivers, the WWAN MHI client driver patch that is making use of the 'name'
  field to apply custom data mux id for Foxconn modems is also included.
  Collected Ack from Networking maintainer for this patch.

MHI EP
======

- Fixed the MHI EP stack to not allocate memory for MHI objects from DMA zone.
  This was done accidentally while adding the slab cache support and causes the
  MHI EP stack to run out of memory while doing high bandwidth transfers.

* tag 'mhi-for-v6.11' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi:
  net: wwan: mhi: make default data link id configurable
  bus: mhi: host: Allow controller drivers to specify name for the MHI controller
  bus: mhi: host: Add support for Foxconn SDX72 modems
  bus: mhi: host: pci_generic: Use unique 'mhi_pci_dev_info' for product families
  bus: mhi: ep: Do not allocate memory for MHI objects from DMA zone
parents f7e46d45 65bc58c3
...@@ -90,7 +90,7 @@ static int mhi_ep_send_completion_event(struct mhi_ep_cntrl *mhi_cntrl, struct m ...@@ -90,7 +90,7 @@ static int mhi_ep_send_completion_event(struct mhi_ep_cntrl *mhi_cntrl, struct m
struct mhi_ring_element *event; struct mhi_ring_element *event;
int ret; int ret;
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA); event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL);
if (!event) if (!event)
return -ENOMEM; return -ENOMEM;
...@@ -109,7 +109,7 @@ int mhi_ep_send_state_change_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_stat ...@@ -109,7 +109,7 @@ int mhi_ep_send_state_change_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_stat
struct mhi_ring_element *event; struct mhi_ring_element *event;
int ret; int ret;
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA); event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL);
if (!event) if (!event)
return -ENOMEM; return -ENOMEM;
...@@ -127,7 +127,7 @@ int mhi_ep_send_ee_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_ee_type exec_e ...@@ -127,7 +127,7 @@ int mhi_ep_send_ee_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_ee_type exec_e
struct mhi_ring_element *event; struct mhi_ring_element *event;
int ret; int ret;
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA); event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL);
if (!event) if (!event)
return -ENOMEM; return -ENOMEM;
...@@ -146,7 +146,7 @@ static int mhi_ep_send_cmd_comp_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_e ...@@ -146,7 +146,7 @@ static int mhi_ep_send_cmd_comp_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_e
struct mhi_ring_element *event; struct mhi_ring_element *event;
int ret; int ret;
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA); event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL);
if (!event) if (!event)
return -ENOMEM; return -ENOMEM;
...@@ -438,7 +438,7 @@ static int mhi_ep_read_channel(struct mhi_ep_cntrl *mhi_cntrl, ...@@ -438,7 +438,7 @@ static int mhi_ep_read_channel(struct mhi_ep_cntrl *mhi_cntrl,
read_offset = mhi_chan->tre_size - mhi_chan->tre_bytes_left; read_offset = mhi_chan->tre_size - mhi_chan->tre_bytes_left;
write_offset = len - buf_left; write_offset = len - buf_left;
buf_addr = kmem_cache_zalloc(mhi_cntrl->tre_buf_cache, GFP_KERNEL | GFP_DMA); buf_addr = kmem_cache_zalloc(mhi_cntrl->tre_buf_cache, GFP_KERNEL);
if (!buf_addr) if (!buf_addr)
return -ENOMEM; return -ENOMEM;
...@@ -1481,14 +1481,14 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl, ...@@ -1481,14 +1481,14 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl,
mhi_cntrl->ev_ring_el_cache = kmem_cache_create("mhi_ep_event_ring_el", mhi_cntrl->ev_ring_el_cache = kmem_cache_create("mhi_ep_event_ring_el",
sizeof(struct mhi_ring_element), 0, sizeof(struct mhi_ring_element), 0,
SLAB_CACHE_DMA, NULL); 0, NULL);
if (!mhi_cntrl->ev_ring_el_cache) { if (!mhi_cntrl->ev_ring_el_cache) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_free_cmd; goto err_free_cmd;
} }
mhi_cntrl->tre_buf_cache = kmem_cache_create("mhi_ep_tre_buf", MHI_EP_DEFAULT_MTU, 0, mhi_cntrl->tre_buf_cache = kmem_cache_create("mhi_ep_tre_buf", MHI_EP_DEFAULT_MTU, 0,
SLAB_CACHE_DMA, NULL); 0, NULL);
if (!mhi_cntrl->tre_buf_cache) { if (!mhi_cntrl->tre_buf_cache) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_destroy_ev_ring_el_cache; goto err_destroy_ev_ring_el_cache;
......
...@@ -399,6 +399,8 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = { ...@@ -399,6 +399,8 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0), MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0),
MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0), MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0),
MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0), MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2), MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2),
MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3), MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
}; };
...@@ -419,8 +421,20 @@ static const struct mhi_controller_config modem_foxconn_sdx55_config = { ...@@ -419,8 +421,20 @@ static const struct mhi_controller_config modem_foxconn_sdx55_config = {
.event_cfg = mhi_foxconn_sdx55_events, .event_cfg = mhi_foxconn_sdx55_events,
}; };
static const struct mhi_pci_dev_info mhi_foxconn_sdx24_info = { static const struct mhi_controller_config modem_foxconn_sdx72_config = {
.name = "foxconn-sdx24", .max_channels = 128,
.timeout_ms = 20000,
.ready_timeout_ms = 50000,
.num_channels = ARRAY_SIZE(mhi_foxconn_sdx55_channels),
.ch_cfg = mhi_foxconn_sdx55_channels,
.num_events = ARRAY_SIZE(mhi_foxconn_sdx55_events),
.event_cfg = mhi_foxconn_sdx55_events,
};
static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
.name = "foxconn-sdx55",
.fw = "qcom/sdx55m/sbl1.mbn",
.edl = "qcom/sdx55m/edl.mbn",
.config = &modem_foxconn_sdx55_config, .config = &modem_foxconn_sdx55_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM, .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32, .dma_data_width = 32,
...@@ -428,8 +442,8 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx24_info = { ...@@ -428,8 +442,8 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx24_info = {
.sideband_wake = false, .sideband_wake = false,
}; };
static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = { static const struct mhi_pci_dev_info mhi_foxconn_t99w175_info = {
.name = "foxconn-sdx55", .name = "foxconn-t99w175",
.fw = "qcom/sdx55m/sbl1.mbn", .fw = "qcom/sdx55m/sbl1.mbn",
.edl = "qcom/sdx55m/edl.mbn", .edl = "qcom/sdx55m/edl.mbn",
.config = &modem_foxconn_sdx55_config, .config = &modem_foxconn_sdx55_config,
...@@ -439,8 +453,19 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = { ...@@ -439,8 +453,19 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
.sideband_wake = false, .sideband_wake = false,
}; };
static const struct mhi_pci_dev_info mhi_foxconn_sdx65_info = { static const struct mhi_pci_dev_info mhi_foxconn_dw5930e_info = {
.name = "foxconn-sdx65", .name = "foxconn-dw5930e",
.fw = "qcom/sdx55m/sbl1.mbn",
.edl = "qcom/sdx55m/edl.mbn",
.config = &modem_foxconn_sdx55_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32,
.mru_default = 32768,
.sideband_wake = false,
};
static const struct mhi_pci_dev_info mhi_foxconn_t99w368_info = {
.name = "foxconn-t99w368",
.config = &modem_foxconn_sdx55_config, .config = &modem_foxconn_sdx55_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM, .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32, .dma_data_width = 32,
...@@ -448,6 +473,55 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx65_info = { ...@@ -448,6 +473,55 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx65_info = {
.sideband_wake = false, .sideband_wake = false,
}; };
static const struct mhi_pci_dev_info mhi_foxconn_t99w373_info = {
.name = "foxconn-t99w373",
.config = &modem_foxconn_sdx55_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32,
.mru_default = 32768,
.sideband_wake = false,
};
static const struct mhi_pci_dev_info mhi_foxconn_t99w510_info = {
.name = "foxconn-t99w510",
.config = &modem_foxconn_sdx55_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32,
.mru_default = 32768,
.sideband_wake = false,
};
static const struct mhi_pci_dev_info mhi_foxconn_dw5932e_info = {
.name = "foxconn-dw5932e",
.config = &modem_foxconn_sdx55_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32,
.mru_default = 32768,
.sideband_wake = false,
};
static const struct mhi_pci_dev_info mhi_foxconn_t99w515_info = {
.name = "foxconn-t99w515",
.edl = "fox/sdx72m/edl.mbn",
.edl_trigger = true,
.config = &modem_foxconn_sdx72_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32,
.mru_default = 32768,
.sideband_wake = false,
};
static const struct mhi_pci_dev_info mhi_foxconn_dw5934e_info = {
.name = "foxconn-dw5934e",
.edl = "fox/sdx72m/edl.mbn",
.edl_trigger = true,
.config = &modem_foxconn_sdx72_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32,
.mru_default = 32768,
.sideband_wake = false,
};
static const struct mhi_channel_config mhi_mv3x_channels[] = { static const struct mhi_channel_config mhi_mv3x_channels[] = {
MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0), MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0),
MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0), MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0),
...@@ -646,40 +720,49 @@ static const struct pci_device_id mhi_pci_id_table[] = { ...@@ -646,40 +720,49 @@ static const struct pci_device_id mhi_pci_id_table[] = {
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info }, .driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
/* T99W175 (sdx55), Both for eSIM and Non-eSIM */ /* T99W175 (sdx55), Both for eSIM and Non-eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0ab), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0ab),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w175_info },
/* DW5930e (sdx55), With eSIM, It's also T99W175 */ /* DW5930e (sdx55), With eSIM, It's also T99W175 */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0b0), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0b0),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5930e_info },
/* DW5930e (sdx55), Non-eSIM, It's also T99W175 */ /* DW5930e (sdx55), Non-eSIM, It's also T99W175 */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0b1), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0b1),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5930e_info },
/* T99W175 (sdx55), Based on Qualcomm new baseline */ /* T99W175 (sdx55), Based on Qualcomm new baseline */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0bf), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0bf),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w175_info },
/* T99W175 (sdx55) */ /* T99W175 (sdx55) */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0c3), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0c3),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w175_info },
/* T99W368 (sdx65) */ /* T99W368 (sdx65) */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d8), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d8),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w368_info },
/* T99W373 (sdx62) */ /* T99W373 (sdx62) */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d9), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d9),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w373_info },
/* T99W510 (sdx24), variant 1 */ /* T99W510 (sdx24), variant 1 */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f0), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f0),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx24_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w510_info },
/* T99W510 (sdx24), variant 2 */ /* T99W510 (sdx24), variant 2 */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f1), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f1),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx24_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w510_info },
/* T99W510 (sdx24), variant 3 */ /* T99W510 (sdx24), variant 3 */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f2), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f2),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx24_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w510_info },
/* DW5932e-eSIM (sdx62), With eSIM */ /* DW5932e-eSIM (sdx62), With eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f5), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f5),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info },
/* DW5932e (sdx62), Non-eSIM */ /* DW5932e (sdx62), Non-eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f9), { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f9),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info },
/* T99W515 (sdx72) */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe118),
.driver_data = (kernel_ulong_t) &mhi_foxconn_t99w515_info },
/* DW5934e(sdx72), With eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11d),
.driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
/* DW5934e(sdx72), Non-eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11e),
.driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info },
/* MV31-W (Cinterion) */ /* MV31-W (Cinterion) */
{ PCI_DEVICE(PCI_VENDOR_ID_THALES, 0x00b3), { PCI_DEVICE(PCI_VENDOR_ID_THALES, 0x00b3),
.driver_data = (kernel_ulong_t) &mhi_mv31_info }, .driver_data = (kernel_ulong_t) &mhi_mv31_info },
...@@ -694,7 +777,7 @@ static const struct pci_device_id mhi_pci_id_table[] = { ...@@ -694,7 +777,7 @@ static const struct pci_device_id mhi_pci_id_table[] = {
.driver_data = (kernel_ulong_t) &mhi_mv32_info }, .driver_data = (kernel_ulong_t) &mhi_mv32_info },
/* T99W175 (sdx55), HP variant */ /* T99W175 (sdx55), HP variant */
{ PCI_DEVICE(0x03f0, 0x0a6c), { PCI_DEVICE(0x03f0, 0x0a6c),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w175_info },
{ } { }
}; };
MODULE_DEVICE_TABLE(pci, mhi_pci_id_table); MODULE_DEVICE_TABLE(pci, mhi_pci_id_table);
...@@ -1003,6 +1086,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1003,6 +1086,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
mhi_cntrl->runtime_get = mhi_pci_runtime_get; mhi_cntrl->runtime_get = mhi_pci_runtime_get;
mhi_cntrl->runtime_put = mhi_pci_runtime_put; mhi_cntrl->runtime_put = mhi_pci_runtime_put;
mhi_cntrl->mru = info->mru_default; mhi_cntrl->mru = info->mru_default;
mhi_cntrl->name = info->name;
if (info->edl_trigger) if (info->edl_trigger)
mhi_cntrl->edl_trigger = mhi_pci_generic_edl_trigger; mhi_cntrl->edl_trigger = mhi_pci_generic_edl_trigger;
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#define MHI_MBIM_LINK_HASH_SIZE 8 #define MHI_MBIM_LINK_HASH_SIZE 8
#define LINK_HASH(session) ((session) % MHI_MBIM_LINK_HASH_SIZE) #define LINK_HASH(session) ((session) % MHI_MBIM_LINK_HASH_SIZE)
#define WDS_BIND_MUX_DATA_PORT_MUX_ID 112
struct mhi_mbim_link { struct mhi_mbim_link {
struct mhi_mbim_context *mbim; struct mhi_mbim_context *mbim;
struct net_device *ndev; struct net_device *ndev;
...@@ -93,6 +95,15 @@ static struct mhi_mbim_link *mhi_mbim_get_link_rcu(struct mhi_mbim_context *mbim ...@@ -93,6 +95,15 @@ static struct mhi_mbim_link *mhi_mbim_get_link_rcu(struct mhi_mbim_context *mbim
return NULL; return NULL;
} }
static int mhi_mbim_get_link_mux_id(struct mhi_controller *cntrl)
{
if (strcmp(cntrl->name, "foxconn-dw5934e") == 0 ||
strcmp(cntrl->name, "foxconn-t99w515") == 0)
return WDS_BIND_MUX_DATA_PORT_MUX_ID;
return 0;
}
static struct sk_buff *mbim_tx_fixup(struct sk_buff *skb, unsigned int session, static struct sk_buff *mbim_tx_fixup(struct sk_buff *skb, unsigned int session,
u16 tx_seq) u16 tx_seq)
{ {
...@@ -596,7 +607,7 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id ...@@ -596,7 +607,7 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
{ {
struct mhi_controller *cntrl = mhi_dev->mhi_cntrl; struct mhi_controller *cntrl = mhi_dev->mhi_cntrl;
struct mhi_mbim_context *mbim; struct mhi_mbim_context *mbim;
int err; int err, link_id;
mbim = devm_kzalloc(&mhi_dev->dev, sizeof(*mbim), GFP_KERNEL); mbim = devm_kzalloc(&mhi_dev->dev, sizeof(*mbim), GFP_KERNEL);
if (!mbim) if (!mbim)
...@@ -617,8 +628,11 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id ...@@ -617,8 +628,11 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
/* Number of transfer descriptors determines size of the queue */ /* Number of transfer descriptors determines size of the queue */
mbim->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE); mbim->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE);
/* Get the corresponding mux_id from mhi */
link_id = mhi_mbim_get_link_mux_id(cntrl);
/* Register wwan link ops with MHI controller representing WWAN instance */ /* Register wwan link ops with MHI controller representing WWAN instance */
return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, 0); return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, link_id);
} }
static void mhi_mbim_remove(struct mhi_device *mhi_dev) static void mhi_mbim_remove(struct mhi_device *mhi_dev)
......
...@@ -290,6 +290,7 @@ struct mhi_controller_config { ...@@ -290,6 +290,7 @@ struct mhi_controller_config {
/** /**
* struct mhi_controller - Master MHI controller structure * struct mhi_controller - Master MHI controller structure
* @name: Device name of the MHI controller
* @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI * @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI
* controller (required) * controller (required)
* @mhi_dev: MHI device instance for the controller * @mhi_dev: MHI device instance for the controller
...@@ -367,6 +368,7 @@ struct mhi_controller_config { ...@@ -367,6 +368,7 @@ struct mhi_controller_config {
* they can be populated depending on the usecase. * they can be populated depending on the usecase.
*/ */
struct mhi_controller { struct mhi_controller {
const char *name;
struct device *cntrl_dev; struct device *cntrl_dev;
struct mhi_device *mhi_dev; struct mhi_device *mhi_dev;
struct dentry *debugfs_dentry; struct dentry *debugfs_dentry;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment