// SPDX-License-Identifier: GPL-2.0-or-later /* * PL-2301/2302 USB host-to-host link cables * Copyright (C) 2000-2005 by David Brownell */ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages #include <linux/module.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> #include <linux/workqueue.h> #include <linux/mii.h> #include <linux/usb.h> #include <linux/usb/usbnet.h> /* * Prolific PL-2301/PL-2302 driver ... http://www.prolific.com.tw/ * * The protocol and handshaking used here should be bug-compatible * with the Linux 2.2 "plusb" driver, by Deti Fliegl. * * HEADS UP: this handshaking isn't all that robust. This driver * gets confused easily if you unplug one end of the cable then * try to connect it again; you'll need to restart both ends. The * "naplink" software (used by some PlayStation/2 developers) does * the handshaking much better! Also, sometimes this hardware * seems to get wedged under load. Prolific docs are weak, and * don't identify differences between PL2301 and PL2302, much less * anything to explain the different PL2302 versions observed. * * NOTE: pl2501 has several modes, including pl2301 and pl2302 * compatibility. Some docs suggest the difference between 2301 * and 2302 is only to make MS-Windows use a different driver... * * pl25a1 glue based on patch from Tony Gibbs. Prolific "docs" on * this chip are as usual incomplete about what control messages * are supported. */ /* * Bits 0-4 can be used for software handshaking; they're set from * one end, cleared from the other, "read" with the interrupt byte. */ #define PL_S_EN … /* reserved bit -- rx ready (6) ? */ #define PL_TX_READY … #define PL_RESET_OUT … #define PL_RESET_IN … #define PL_TX_C … #define PL_TX_REQ … #define PL_PEER_E … static inline int pl_vendor_req(struct usbnet *dev, u8 req, u8 val, u8 index) { … } static inline int pl_set_QuickLink_features(struct usbnet *dev, int val) { … } static int pl_reset(struct usbnet *dev) { … } static const struct driver_info prolific_info = …; /*-------------------------------------------------------------------------*/ /* * Proilific's name won't normally be on the cables, and * may not be on the device. */ static const struct usb_device_id products [] = …; MODULE_DEVICE_TABLE(usb, products); static struct usb_driver plusb_driver = …; module_usb_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …;