linux/drivers/isdn/hardware/mISDN/hfcsusb.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* hfcsusb.c
 * mISDN driver for Colognechip HFC-S USB chip
 *
 * Copyright 2001 by Peter Sprenger ([email protected])
 * Copyright 2008 by Martin Bachem ([email protected])
 *
 * module params
 *   debug=<n>, default=0, with n=0xHHHHGGGG
 *      H - l1 driver flags described in hfcsusb.h
 *      G - common mISDN debug flags described at mISDNhw.h
 *
 *   poll=<n>, default 128
 *     n : burst size of PH_DATA_IND at transparent rx data
 *
 * Revision: 0.3.3 (socket), 2008-11-05
 */

#include <linux/module.h>
#include <linux/delay.h>
#include <linux/usb.h>
#include <linux/mISDNhw.h>
#include <linux/slab.h>
#include "hfcsusb.h"

static unsigned int debug;
static int poll =;

static LIST_HEAD(HFClist);
static DEFINE_RWLOCK(HFClock);


MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
module_param(debug, uint, S_IRUGO | S_IWUSR);
module_param(poll, int, 0);

static int hfcsusb_cnt;

/* some function prototypes */
static void hfcsusb_ph_command(struct hfcsusb *hw, u_char command);
static void release_hw(struct hfcsusb *hw);
static void reset_hfcsusb(struct hfcsusb *hw);
static void setPortMode(struct hfcsusb *hw);
static void hfcsusb_start_endpoint(struct hfcsusb *hw, int channel);
static void hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel);
static int  hfcsusb_setup_bch(struct bchannel *bch, int protocol);
static void deactivate_bchannel(struct bchannel *bch);
static int  hfcsusb_ph_info(struct hfcsusb *hw);

/* start next background transfer for control channel */
static void
ctrl_start_transfer(struct hfcsusb *hw)
{}

/*
 * queue a control transfer request to write HFC-S USB
 * chip register using CTRL resuest queue
 */
static int write_reg(struct hfcsusb *hw, __u8 reg, __u8 val)
{}

/* control completion routine handling background control cmds */
static void
ctrl_complete(struct urb *urb)
{}

/* handle LED bits   */
static void
set_led_bit(struct hfcsusb *hw, signed short led_bits, int set_on)
{}

/* handle LED requests  */
static void
handle_led(struct hfcsusb *hw, int event)
{}

/*
 * Layer2 -> Layer 1 Bchannel data
 */
static int
hfcusb_l2l1B(struct mISDNchannel *ch, struct sk_buff *skb)
{}

/*
 * send full D/B channel status information
 * as MPH_INFORMATION_IND
 */
static int
hfcsusb_ph_info(struct hfcsusb *hw)
{}

/*
 * Layer2 -> Layer 1 Dchannel data
 */
static int
hfcusb_l2l1D(struct mISDNchannel *ch, struct sk_buff *skb)
{}

/*
 * Layer 1 callback function
 */
static int
hfc_l1callback(struct dchannel *dch, u_int cmd)
{}

static int
open_dchannel(struct hfcsusb *hw, struct mISDNchannel *ch,
	      struct channel_req *rq)
{}

static int
open_bchannel(struct hfcsusb *hw, struct channel_req *rq)
{}

static int
channel_ctrl(struct hfcsusb *hw, struct mISDN_ctrl_req *cq)
{}

/*
 * device control function
 */
static int
hfc_dctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
{}

/*
 * S0 TE state change event handler
 */
static void
ph_state_te(struct dchannel *dch)
{}

/*
 * S0 NT state change event handler
 */
static void
ph_state_nt(struct dchannel *dch)
{}

static void
ph_state(struct dchannel *dch)
{}

/*
 * disable/enable BChannel for desired protocol
 */
static int
hfcsusb_setup_bch(struct bchannel *bch, int protocol)
{}

static void
hfcsusb_ph_command(struct hfcsusb *hw, u_char command)
{}

/*
 * Layer 1 B-channel hardware access
 */
static int
channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq)
{}

/* collect data from incoming interrupt or isochron USB data */
static void
hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
		 int finish)
{}

static void
fill_isoc_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe,
	      void *buf, int num_packets, int packet_size, int interval,
	      usb_complete_t complete, void *context)
{}

/* receive completion routine for all ISO tx fifos   */
static void
rx_iso_complete(struct urb *urb)
{}

/* receive completion routine for all interrupt rx fifos */
static void
rx_int_complete(struct urb *urb)
{}

/* transmit completion routine for all ISO tx fifos */
static void
tx_iso_complete(struct urb *urb)
{}

/*
 * allocs urbs and start isoc transfer with two pending urbs to avoid
 * gaps in the transfer chain
 */
static int
start_isoc_chain(struct usb_fifo *fifo, int num_packets_per_urb,
		 usb_complete_t complete, int packet_size)
{}

static void
stop_iso_gracefull(struct usb_fifo *fifo)
{}

static void
stop_int_gracefull(struct usb_fifo *fifo)
{}

/* start the interrupt transfer for the given fifo */
static void
start_int_fifo(struct usb_fifo *fifo)
{}

static void
setPortMode(struct hfcsusb *hw)
{}

static void
reset_hfcsusb(struct hfcsusb *hw)
{}

/* start USB data pipes dependand on device's endpoint configuration */
static void
hfcsusb_start_endpoint(struct hfcsusb *hw, int channel)
{}

/* stop USB data pipes dependand on device's endpoint configuration */
static void
hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel)
{}


/* Hardware Initialization */
static int
setup_hfcsusb(struct hfcsusb *hw)
{}

static void
release_hw(struct hfcsusb *hw)
{}

static void
deactivate_bchannel(struct bchannel *bch)
{}

/*
 * Layer 1 B-channel hardware access
 */
static int
hfc_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
{}

static int
setup_instance(struct hfcsusb *hw, struct device *parent)
{}

static int
hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
{}

/* function called when an active device is removed */
static void
hfcsusb_disconnect(struct usb_interface *intf)
{}

static struct usb_driver hfcsusb_drv =;

module_usb_driver();