Don't call dbctty driver functions directly from dbc core code.
Introduce a new dbc_driver structure that contains function pointers
for disconnect and configure operations.
The driver (ttydbc) must provide these opeations when creating a dbc.
Name the structure dbc_driver instead of dbc_ops as we plan to
add more driver configureable values here, such as vid and pid.
Decouples dbc and dbctty.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-26-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Split the dbc tty driver registrations function into separate
init and probe parts.
The init part will register the tty driver, and should in the future be
called from module_init().
The probe part will become the normal probe function, but for now it is
called from the init part.
The unregister function is s likewise split into remove and exit parts.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-25-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Don't pass endpoint pointer, dbctty should not be aware of
struct dbc_ep, knowing the direction is enough.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-23-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The dbc request completion callback doesn't need a xhci_hcd pointer.
The only user of the xhci_hcd pointer in dbgtty request callback was
the xhci_warn() function. Change it to dev_warn() instead.
While changing the callback function parameter to dbc in struct
xhci_requeset, move the struct xhci_request declaraion down a bit in the
header file to avoid compiler warinings
No functional changes
This change helps decoupling xhci and DbC
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-18-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Pass dbc pointer instead of struct xhci_hcd pointer to the get_in_ep() and
get_out_ep() helper functions.
No functional changes
This change helps decoupling xhci and DbC
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-17-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Pass dbc pointer to the xhci_dbc_tty_register_device() and
xhci_dbc_tty_unregister_device() functions instead of xhci_hcd pointer
These functions don't need a xhci_hcd pointer anymore, only use case was
the xhci_err() function, which is now changed to a dev_err() instead.
No functional changes
This change helps decoupling xhci and DbC
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-16-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Currently the dbc structure contains a pointer to struct xhci_hcd,
and dbc functions use that to dig up the underlying device pointer.
We are trying to decouple xhci and dbc code, and prepare for
code that use dbc such as dbctty into into real device drivers.
This is one step along the way.
Keep functionality the same and keep the xhci pointer, and
let the new device pointer point to the xhci device for now.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-8-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
xHCI compatible USB host controllers(i.e. super-speed USB3 controllers)
can be implemented with the Debug Capability(DbC). It presents a debug
device which is fully compliant with the USB framework and provides the
equivalent of a very high performance full-duplex serial link. The debug
capability operation model and registers interface are defined in 7.6.8
of the xHCI specification, revision 1.1.
The DbC debug device shares a root port with the xHCI host. By default,
the debug capability is disabled and the root port is assigned to xHCI.
When the DbC is enabled, the root port will be assigned to the DbC debug
device, and the xHCI sees nothing on this port. This implementation uses
a sysfs node named <dbc> under the xHCI device to manage the enabling
and disabling of the debug capability.
When the debug capability is enabled, it will present a debug device
through the debug port. This debug device is fully compliant with the
USB3 framework, and it can be enumerated by a debug host on the other
end of the USB link. As soon as the debug device is configured, a TTY
serial device named /dev/ttyDBC0 will be created.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>