~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/usb/gadget/fsl_qe_udc.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1148
1148
static int txcomplete(struct qe_ep *ep, unsigned char restart)
1149
1149
{
1150
1150
        if (ep->tx_req != NULL) {
 
1151
                struct qe_req *req = ep->tx_req;
 
1152
                unsigned zlp = 0, last_len = 0;
 
1153
 
 
1154
                last_len = min_t(unsigned, req->req.length - ep->sent,
 
1155
                                ep->ep.maxpacket);
 
1156
 
1151
1157
                if (!restart) {
1152
1158
                        int asent = ep->last;
1153
1159
                        ep->sent += asent;
1156
1162
                        ep->last = 0;
1157
1163
                }
1158
1164
 
 
1165
                /* zlp needed when req->re.zero is set */
 
1166
                if (req->req.zero) {
 
1167
                        if (last_len == 0 ||
 
1168
                                (req->req.length % ep->ep.maxpacket) != 0)
 
1169
                                zlp = 0;
 
1170
                        else
 
1171
                                zlp = 1;
 
1172
                } else
 
1173
                        zlp = 0;
 
1174
 
1159
1175
                /* a request already were transmitted completely */
1160
 
                if ((ep->tx_req->req.length - ep->sent) <= 0) {
1161
 
                        ep->tx_req->req.actual = (unsigned int)ep->sent;
 
1176
                if (((ep->tx_req->req.length - ep->sent) <= 0) && !zlp) {
1162
1177
                        done(ep, ep->tx_req, 0);
1163
1178
                        ep->tx_req = NULL;
1164
1179
                        ep->last = 0;
1191
1206
        buf = (u8 *)ep->tx_req->req.buf + ep->sent;
1192
1207
        if (buf && size) {
1193
1208
                ep->last = size;
 
1209
                ep->tx_req->req.actual += size;
1194
1210
                frame_set_data(frame, buf);
1195
1211
                frame_set_length(frame, size);
1196
1212
                frame_set_status(frame, FRAME_OK);
2523
2539
}
2524
2540
 
2525
2541
/* Driver probe functions */
2526
 
static int __devinit qe_udc_probe(struct platform_device *ofdev,
2527
 
                        const struct of_device_id *match)
 
2542
static const struct of_device_id qe_udc_match[];
 
2543
static int __devinit qe_udc_probe(struct platform_device *ofdev)
2528
2544
{
 
2545
        const struct of_device_id *match;
2529
2546
        struct device_node *np = ofdev->dev.of_node;
2530
2547
        struct qe_ep *ep;
2531
2548
        unsigned int ret = 0;
2532
2549
        unsigned int i;
2533
2550
        const void *prop;
2534
2551
 
 
2552
        match = of_match_device(qe_udc_match, &ofdev->dev);
 
2553
        if (!match)
 
2554
                return -EINVAL;
 
2555
 
2535
2556
        prop = of_get_property(np, "mode", NULL);
2536
2557
        if (!prop || strcmp(prop, "peripheral"))
2537
2558
                return -ENODEV;
2768
2789
 
2769
2790
MODULE_DEVICE_TABLE(of, qe_udc_match);
2770
2791
 
2771
 
static struct of_platform_driver udc_driver = {
 
2792
static struct platform_driver udc_driver = {
2772
2793
        .driver = {
2773
2794
                .name = (char *)driver_name,
2774
2795
                .owner = THIS_MODULE,
2786
2807
{
2787
2808
        printk(KERN_INFO "%s: %s, %s\n", driver_name, driver_desc,
2788
2809
                        DRIVER_VERSION);
2789
 
        return of_register_platform_driver(&udc_driver);
 
2810
        return platform_driver_register(&udc_driver);
2790
2811
}
2791
2812
 
2792
2813
static void __exit qe_udc_exit(void)
2793
2814
{
2794
 
        of_unregister_platform_driver(&udc_driver);
 
2815
        platform_driver_unregister(&udc_driver);
2795
2816
}
2796
2817
 
2797
2818
module_init(qe_udc_init);