return -EINVAL;
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
-@@ -251,6 +251,24 @@ static const struct rt6_info ip6_prohibi
+@@ -250,6 +250,24 @@ static const struct rt6_info ip6_prohibi
.rt6i_ref = ATOMIC_INIT(1),
};
static const struct rt6_info ip6_blk_hole_entry_template = {
.dst = {
.__refcnt = ATOMIC_INIT(1),
-@@ -1511,6 +1529,9 @@ int ip6_route_add(struct fib6_config *cf
- case RTN_THROW:
- rt->dst.error = -EAGAIN;
+@@ -1509,6 +1527,11 @@ int ip6_route_add(struct fib6_config *cf
+ rt->dst.output = ip6_pkt_prohibit_out;
+ rt->dst.input = ip6_pkt_prohibit;
break;
+ case RTN_FAILED_POLICY:
+ rt->dst.error = -EPERM;
++ rt->dst.output = ip6_pkt_failed_policy_out;
++ rt->dst.input = ip6_pkt_failed_policy;
+ break;
+ case RTN_THROW:
default:
- rt->dst.error = -ENETUNREACH;
- break;
-@@ -2090,6 +2111,17 @@ static int ip6_pkt_prohibit_out(struct s
+ rt->dst.error = (cfg->fc_type == RTN_THROW) ? -EAGAIN
+@@ -2088,6 +2111,17 @@ static int ip6_pkt_prohibit_out(struct s
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
}
+ return ip6_pkt_drop(skb, ICMPV6_POLICY_FAIL, IPSTATS_MIB_OUTNOROUTES);
+}
+
- #endif
-
/*
-@@ -2296,7 +2328,8 @@ static int rtm_to_fib6_config(struct sk_
+ * Allocate a dst for local (unicast / anycast) address.
+ */
+@@ -2290,7 +2324,8 @@ static int rtm_to_fib6_config(struct sk_
if (rtm->rtm_type == RTN_UNREACHABLE ||
rtm->rtm_type == RTN_BLACKHOLE ||
rtm->rtm_type == RTN_PROHIBIT ||
cfg->fc_flags |= RTF_REJECT;
if (rtm->rtm_type == RTN_LOCAL)
-@@ -2498,6 +2531,9 @@ static int rt6_fill_node(struct net *net
+@@ -2492,6 +2527,9 @@ static int rt6_fill_node(struct net *net
case -EACCES:
rtm->rtm_type = RTN_PROHIBIT;
break;
case -EAGAIN:
rtm->rtm_type = RTN_THROW;
break;
-@@ -2748,6 +2784,8 @@ static int ip6_route_dev_notify(struct n
+@@ -2742,6 +2780,8 @@ static int ip6_route_dev_notify(struct n
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
#endif
-@@ -3008,6 +3046,17 @@ static int __net_init ip6_route_net_init
+@@ -3002,6 +3042,17 @@ static int __net_init ip6_route_net_init
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
ip6_template_metrics, true);
#endif
net->ipv6.sysctl.flush_delay = 0;
-@@ -3026,6 +3075,8 @@ out:
+@@ -3020,6 +3071,8 @@ out:
return ret;
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
out_ip6_prohibit_entry:
kfree(net->ipv6.ip6_prohibit_entry);
out_ip6_null_entry:
-@@ -3043,6 +3094,7 @@ static void __net_exit ip6_route_net_exi
+@@ -3037,6 +3090,7 @@ static void __net_exit ip6_route_net_exi
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
kfree(net->ipv6.ip6_prohibit_entry);
kfree(net->ipv6.ip6_blk_hole_entry);
#endif
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
}
-@@ -3139,6 +3191,9 @@ int __init ip6_route_init(void)
+@@ -3133,6 +3187,9 @@ int __init ip6_route_init(void)
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
-Index: linux-3.10.26/drivers/usb/core/hub.c
-===================================================================
---- linux-3.10.26.orig/drivers/usb/core/hub.c 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/core/hub.c 2014-01-19 16:29:18.548615960 +0000
-@@ -1259,7 +1259,7 @@
+--- a/drivers/usb/core/hub.c
++++ b/drivers/usb/core/hub.c
+@@ -1259,7 +1259,7 @@ static void hub_quiesce(struct usb_hub *
if (type != HUB_SUSPEND) {
/* Disconnect all the children */
for (i = 0; i < hdev->maxchild; ++i) {
usb_disconnect(&hub->ports[i]->child);
}
}
-Index: linux-3.10.26/drivers/usb/core/port.c
-===================================================================
---- linux-3.10.26.orig/drivers/usb/core/port.c 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/core/port.c 2014-01-19 16:29:18.548615960 +0000
-@@ -193,6 +193,7 @@
+--- a/drivers/usb/core/port.c
++++ b/drivers/usb/core/port.c
+@@ -193,6 +193,7 @@ exit:
void usb_hub_remove_port_device(struct usb_hub *hub,
int port1)
{
+ device_unregister(&hub->ports[port1 - 1]->dev);
}
-Index: linux-3.10.26/drivers/usb/host/Kconfig
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/Kconfig 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/host/Kconfig 2014-01-19 16:29:18.548615960 +0000
-@@ -28,7 +28,11 @@
+--- a/drivers/usb/host/Kconfig
++++ b/drivers/usb/host/Kconfig
+@@ -28,7 +28,11 @@ config USB_XHCI_HCD
if USB_XHCI_HCD
config USB_XHCI_PLATFORM
config USB_XHCI_HCD_DEBUGGING
bool "Debugging for the xHCI host controller"
-Index: linux-3.10.26/drivers/usb/host/Makefile
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/Makefile 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/host/Makefile 2014-01-19 16:30:54.964617843 +0000
-@@ -13,15 +13,23 @@
+--- a/drivers/usb/host/Makefile
++++ b/drivers/usb/host/Makefile
+@@ -13,15 +13,23 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
xhci-hcd-y := xhci.o xhci-mem.o
xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
-Index: linux-3.10.26/drivers/usb/host/pci-quirks.h
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/pci-quirks.h 2014-01-19 16:29:17.392615927 +0000
-+++ linux-3.10.26/drivers/usb/host/pci-quirks.h 2014-01-19 16:29:18.548615960 +0000
+--- a/drivers/usb/host/pci-quirks.h
++++ b/drivers/usb/host/pci-quirks.h
@@ -1,7 +1,7 @@
#ifndef __LINUX_USB_PCI_QUIRKS_H
#define __LINUX_USB_PCI_QUIRKS_H
+#if defined (CONFIG_PCI) && !defined (CONFIG_USB_MT7621_XHCI_PLATFORM)
void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
- bool usb_is_intel_switchable_xhci(struct pci_dev *pdev);
-Index: linux-3.10.26/drivers/usb/host/xhci.c
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/xhci.c 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/host/xhci.c 2014-01-19 16:29:18.548615960 +0000
+ #endif /* CONFIG_PCI */
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
@@ -30,6 +30,16 @@
#include "xhci.h"
#define DRIVER_AUTHOR "Sarah Sharp"
#define DRIVER_DESC "'eXtensible' Host Controller (xHC) Driver"
-@@ -38,6 +48,18 @@
+@@ -38,6 +48,18 @@ static int link_quirk;
module_param(link_quirk, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(link_quirk, "Don't clear the chain bit on a link TRB");
/* TODO: copied from ehci-hcd.c - can this be refactored? */
/*
* xhci_handshake - spin reading hc until handshake completes or fails
-@@ -189,7 +211,7 @@
+@@ -189,7 +211,7 @@ int xhci_reset(struct xhci_hcd *xhci)
return ret;
}
static int xhci_free_msi(struct xhci_hcd *xhci)
{
int i;
-@@ -386,6 +408,7 @@
+@@ -386,6 +408,7 @@ static int xhci_try_enable_msi(struct us
return ret;
}
hcd->irq = pdev->irq;
return 0;
}
-@@ -427,6 +450,11 @@
+@@ -427,6 +450,11 @@ static void compliance_mode_recovery(uns
xhci_dbg(xhci, "Attempting compliance mode recovery\n");
hcd = xhci->shared_hcd;
if (hcd->state == HC_STATE_SUSPENDED)
usb_hcd_resume_root_hub(hcd);
-@@ -475,6 +503,9 @@
+@@ -475,6 +503,9 @@ bool xhci_compliance_mode_recovery_timer
{
const char *dmi_product_name, *dmi_sys_vendor;
dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME);
dmi_sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR);
if (!dmi_product_name || !dmi_sys_vendor)
-@@ -518,6 +549,10 @@
+@@ -518,6 +549,10 @@ int xhci_init(struct usb_hcd *hcd)
} else {
xhci_dbg(xhci, "xHCI doesn't need link TRB QUIRK\n");
}
retval = xhci_mem_init(xhci, GFP_KERNEL);
xhci_dbg(xhci, "Finished xhci_init\n");
-@@ -661,7 +696,11 @@
+@@ -661,7 +696,11 @@ int xhci_run(struct usb_hcd *hcd)
xhci_dbg(xhci, "// Set the interrupt modulation register\n");
temp = xhci_readl(xhci, &xhci->ir_set->irq_control);
temp &= ~ER_IRQ_INTERVAL_MASK;
xhci_writel(xhci, temp, &xhci->ir_set->irq_control);
/* Set the HCD state before we enable the irqs */
-@@ -682,6 +721,9 @@
+@@ -682,6 +721,9 @@ int xhci_run(struct usb_hcd *hcd)
xhci_queue_vendor_command(xhci, 0, 0, 0,
TRB_TYPE(TRB_NEC_GET_FW));
xhci_dbg(xhci, "Finished xhci_run for USB2 roothub\n");
return 0;
}
-@@ -999,7 +1041,6 @@
+@@ -999,7 +1041,6 @@ int xhci_resume(struct xhci_hcd *xhci, b
/* If restore operation fails, re-initialize the HC during resume */
if ((temp & STS_SRE) || hibernated) {
if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) &&
!(xhci_all_ports_seen_u0(xhci))) {
del_timer_sync(&xhci->comp_mode_recovery_timer);
-@@ -1583,6 +1624,13 @@
+@@ -1583,6 +1624,13 @@ int xhci_drop_endpoint(struct usb_hcd *h
u32 drop_flag;
u32 new_add_flags, new_drop_flags, new_slot_info;
int ret;
ret = xhci_check_args(hcd, udev, ep, 1, true, __func__);
if (ret <= 0)
-@@ -1634,6 +1682,40 @@
+@@ -1634,6 +1682,40 @@ int xhci_drop_endpoint(struct usb_hcd *h
xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep);
xhci_dbg(xhci, "drop ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x, new slot info = %#x\n",
(unsigned int) ep->desc.bEndpointAddress,
udev->slot_id,
-@@ -1669,6 +1751,18 @@
+@@ -1669,6 +1751,18 @@ int xhci_add_endpoint(struct usb_hcd *hc
u32 new_add_flags, new_drop_flags, new_slot_info;
struct xhci_virt_device *virt_dev;
int ret = 0;
ret = xhci_check_args(hcd, udev, ep, 1, true, __func__);
if (ret <= 0) {
-@@ -1731,6 +1825,56 @@
+@@ -1731,6 +1825,56 @@ int xhci_add_endpoint(struct usb_hcd *hc
return -ENOMEM;
}
ctrl_ctx->add_flags |= cpu_to_le32(added_ctxs);
new_add_flags = le32_to_cpu(ctrl_ctx->add_flags);
-@@ -2694,7 +2838,7 @@
+@@ -2694,7 +2838,7 @@ int xhci_check_bandwidth(struct usb_hcd
if (ctrl_ctx->add_flags == cpu_to_le32(SLOT_FLAG) &&
ctrl_ctx->drop_flags == 0)
return 0;
xhci_dbg(xhci, "New Input Control Context:\n");
slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
xhci_dbg_ctx(xhci, virt_dev->in_ctx,
-@@ -4230,10 +4374,14 @@
+@@ -4230,10 +4374,14 @@ static u16 xhci_call_host_update_timeout
u16 *timeout)
{
if (state == USB3_LPM_U1) {
return xhci_calculate_intel_u2_timeout(udev, desc);
}
-@@ -4659,7 +4807,9 @@
+@@ -4659,7 +4807,9 @@ int xhci_gen_setup(struct usb_hcd *hcd,
/* Accept arbitrarily long scatter-gather lists */
hcd->self.sg_tablesize = ~0;
/* XHCI controllers don't stop the ep queue on short packets :| */
if (usb_hcd_is_primary_hcd(hcd)) {
xhci = kzalloc(sizeof(struct xhci_hcd), GFP_KERNEL);
-@@ -4728,6 +4878,10 @@
+@@ -4728,6 +4878,10 @@ int xhci_gen_setup(struct usb_hcd *hcd,
goto error;
xhci_dbg(xhci, "Reset complete\n");
temp = xhci_readl(xhci, &xhci->cap_regs->hcc_params);
if (HCC_64BIT_ADDR(temp)) {
xhci_dbg(xhci, "Enabling 64-bit DMA addresses.\n");
-@@ -4752,8 +4906,21 @@
+@@ -4752,8 +4906,21 @@ MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_LICENSE("GPL");
int retval;
retval = xhci_register_pci();
-@@ -4766,6 +4933,33 @@
+@@ -4766,6 +4933,33 @@ static int __init xhci_hcd_init(void)
printk(KERN_DEBUG "Problem registering platform driver.");
goto unreg_pci;
}
/*
* Check the compiler generated sizes of structures that must be laid
* out in specific ways for hardware access.
-@@ -4783,6 +4977,7 @@
+@@ -4783,6 +4977,7 @@ static int __init xhci_hcd_init(void)
BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8);
/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
return 0;
unreg_pci:
xhci_unregister_pci();
-Index: linux-3.10.26/drivers/usb/host/xhci-dbg.c
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/xhci-dbg.c 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/host/xhci-dbg.c 2014-01-19 16:29:18.548615960 +0000
+--- a/drivers/usb/host/xhci-dbg.c
++++ b/drivers/usb/host/xhci-dbg.c
@@ -21,6 +21,9 @@
*/
#define XHCI_INIT_VALUE 0x0
-Index: linux-3.10.26/drivers/usb/host/xhci.h
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/xhci.h 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/host/xhci.h 2014-01-19 16:29:18.548615960 +0000
+--- a/drivers/usb/host/xhci.h
++++ b/drivers/usb/host/xhci.h
@@ -29,9 +29,24 @@
#include <linux/usb/hcd.h>
/* xHCI PCI Configuration Registers */
#define XHCI_SBRN_OFFSET (0x60)
-@@ -1536,8 +1551,12 @@
+@@ -1536,8 +1551,12 @@ struct xhci_hcd {
/* Compliance Mode Recovery Data */
struct timer_list comp_mode_recovery_timer;
u32 port_status_u0;
};
/* convert between an HCD pointer and the corresponding EHCI_HCD */
-@@ -1703,7 +1722,7 @@
+@@ -1703,7 +1722,7 @@ void xhci_urb_free_priv(struct xhci_hcd
void xhci_free_command(struct xhci_hcd *xhci,
struct xhci_command *command);
/* xHCI PCI glue */
int xhci_register_pci(void);
void xhci_unregister_pci(void);
-Index: linux-3.10.26/drivers/usb/host/xhci-mem.c
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/xhci-mem.c 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/host/xhci-mem.c 2014-01-19 16:29:18.548615960 +0000
-@@ -65,6 +65,9 @@
+--- a/drivers/usb/host/xhci-mem.c
++++ b/drivers/usb/host/xhci-mem.c
+@@ -65,6 +65,9 @@ static struct xhci_segment *xhci_segment
static void xhci_segment_free(struct xhci_hcd *xhci, struct xhci_segment *seg)
{
if (seg->trbs) {
dma_pool_free(xhci->segment_pool, seg->trbs, seg->dma);
seg->trbs = NULL;
-@@ -1446,9 +1449,17 @@
+@@ -1446,9 +1449,17 @@ int xhci_endpoint_init(struct xhci_hcd *
max_burst = (usb_endpoint_maxp(&ep->desc)
& 0x1800) >> 11;
}
break;
default:
BUG();
-Index: linux-3.10.26/drivers/usb/host/xhci-plat.c
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/xhci-plat.c 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/host/xhci-plat.c 2014-01-19 16:29:18.548615960 +0000
-@@ -25,6 +25,13 @@
+--- a/drivers/usb/host/xhci-plat.c
++++ b/drivers/usb/host/xhci-plat.c
+@@ -25,6 +25,13 @@ static void xhci_plat_quirks(struct devi
* dev struct in order to setup MSI
*/
xhci->quirks |= XHCI_PLAT;
}
/* called during probe() after chip reset completes */
-@@ -96,20 +103,32 @@
+@@ -96,20 +103,32 @@ static int xhci_plat_probe(struct platfo
driver = &xhci_plat_xhci_driver;
if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
driver->description)) {
-Index: linux-3.10.26/drivers/usb/host/xhci-ring.c
-===================================================================
---- linux-3.10.26.orig/drivers/usb/host/xhci-ring.c 2014-01-09 20:25:15.000000000 +0000
-+++ linux-3.10.26/drivers/usb/host/xhci-ring.c 2014-01-19 16:29:18.548615960 +0000
-@@ -236,7 +236,6 @@
+--- a/drivers/usb/host/xhci-ring.c
++++ b/drivers/usb/host/xhci-ring.c
+@@ -236,7 +236,6 @@ static void inc_enq(struct xhci_hcd *xhc
*/
if (!chain && !more_trbs_coming)
break;
/* If we're not dealing with 0.95 hardware or
* isoc rings on AMD 0.96 host,
* carry over the chain bit of the previous TRB
-@@ -273,16 +272,20 @@
+@@ -273,16 +272,20 @@ static void inc_enq(struct xhci_hcd *xhc
static inline int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring,
unsigned int num_trbs)
{
return 1;
}
-@@ -2910,6 +2913,7 @@
+@@ -2910,6 +2913,7 @@ static int prepare_ring(struct xhci_hcd
next = ring->enqueue;
while (last_trb(xhci, ring, ring->enq_seg, next)) {
/* If we're not dealing with 0.95 hardware or isoc rings
* on AMD 0.96 host, clear the chain bit.
*/
-@@ -2919,7 +2923,9 @@
+@@ -2919,7 +2923,9 @@ static int prepare_ring(struct xhci_hcd
next->link.control &= cpu_to_le32(~TRB_CHAIN);
else
next->link.control |= cpu_to_le32(TRB_CHAIN);
wmb();
next->link.control ^= cpu_to_le32(TRB_CYCLE);
-@@ -3049,6 +3055,9 @@
+@@ -3049,6 +3055,9 @@ static void giveback_first_trb(struct xh
start_trb->field[3] |= cpu_to_le32(start_cycle);
else
start_trb->field[3] &= cpu_to_le32(~TRB_CYCLE);
xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id);
}
-@@ -3108,6 +3117,29 @@
+@@ -3108,6 +3117,29 @@ static u32 xhci_td_remainder(unsigned in
return (remainder >> 10) << 17;
}
/*
* For xHCI 1.0 host controllers, TD size is the number of max packet sized
* packets remaining in the TD (*not* including this TRB).
-@@ -3245,6 +3277,7 @@
+@@ -3245,6 +3277,7 @@ static int queue_bulk_sg_tx(struct xhci_
}
/* Set the TRB length, TD size, and interrupter fields. */
if (xhci->hci_version < 0x100) {
remainder = xhci_td_remainder(
urb->transfer_buffer_length -
-@@ -3254,6 +3287,13 @@
+@@ -3254,6 +3287,13 @@ static int queue_bulk_sg_tx(struct xhci_
trb_buff_len, total_packet_count, urb,
num_trbs - 1);
}
length_field = TRB_LEN(trb_buff_len) |
remainder |
TRB_INTR_TARGET(0);
-@@ -3316,6 +3356,9 @@
+@@ -3316,6 +3356,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
int running_total, trb_buff_len, ret;
unsigned int total_packet_count;
u64 addr;
if (urb->num_sgs)
return queue_bulk_sg_tx(xhci, mem_flags, urb, slot_id, ep_index);
-@@ -3341,6 +3384,25 @@
+@@ -3341,6 +3384,25 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
running_total += TRB_MAX_BUFF_SIZE;
}
/* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */
ret = prepare_transfer(xhci, xhci->devs[slot_id],
ep_index, urb->stream_id,
-@@ -3400,6 +3462,7 @@
+@@ -3400,6 +3462,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
field |= TRB_ISP;
/* Set the TRB length, TD size, and interrupter fields. */
if (xhci->hci_version < 0x100) {
remainder = xhci_td_remainder(
urb->transfer_buffer_length -
-@@ -3409,6 +3472,10 @@
+@@ -3409,6 +3472,10 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
trb_buff_len, total_packet_count, urb,
num_trbs - 1);
}
length_field = TRB_LEN(trb_buff_len) |
remainder |
TRB_INTR_TARGET(0);
-@@ -3498,7 +3565,11 @@
+@@ -3498,7 +3565,11 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
field |= 0x1;
/* xHCI 1.0 6.4.1.2.1: Transfer Type field */
if (urb->transfer_buffer_length > 0) {
if (setup->bRequestType & USB_DIR_IN)
field |= TRB_TX_TYPE(TRB_DATA_IN);
-@@ -3522,7 +3593,12 @@
+@@ -3522,7 +3593,12 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
field = TRB_TYPE(TRB_DATA);
length_field = TRB_LEN(urb->transfer_buffer_length) |
TRB_INTR_TARGET(0);
if (urb->transfer_buffer_length > 0) {
if (setup->bRequestType & USB_DIR_IN)
-@@ -3533,7 +3609,7 @@
+@@ -3533,7 +3609,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
length_field,
field | ep_ring->cycle_state);
}
/* Save the DMA address of the last TRB in the TD */
td->last_trb = ep_ring->enqueue;
-@@ -3645,6 +3721,9 @@
+@@ -3645,6 +3721,9 @@ static int xhci_queue_isoc_tx(struct xhc
u64 start_addr, addr;
int i, j;
bool more_trbs_coming;
ep_ring = xhci->devs[slot_id]->eps[ep_index].ring;
-@@ -3658,6 +3737,21 @@
+@@ -3658,6 +3737,21 @@ static int xhci_queue_isoc_tx(struct xhc
start_trb = &ep_ring->enqueue->generic;
start_cycle = ep_ring->cycle_state;
urb_priv = urb->hcpriv;
/* Queue the first TRB, even if it's zero-length */
for (i = 0; i < num_tds; i++) {
-@@ -3729,9 +3823,13 @@
+@@ -3729,9 +3823,13 @@ static int xhci_queue_isoc_tx(struct xhc
} else {
td->last_trb = ep_ring->enqueue;
field |= TRB_IOC;
/* Set BEI bit except for the last td */
if (i < num_tds - 1)
field |= TRB_BEI;
-@@ -3746,6 +3844,7 @@
+@@ -3746,6 +3844,7 @@ static int xhci_queue_isoc_tx(struct xhc
trb_buff_len = td_remain_len;
/* Set the TRB length, TD size, & interrupter fields. */
if (xhci->hci_version < 0x100) {
remainder = xhci_td_remainder(
td_len - running_total);
-@@ -3755,6 +3854,10 @@
+@@ -3755,6 +3854,10 @@ static int xhci_queue_isoc_tx(struct xhc
total_packet_count, urb,
(trbs_per_td - j - 1));
}