^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* DVB USB compliant Linux driver for the TwinhanDTV StarBox USB2.0 DVB-S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * receiver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2005 Ralph Metzler <rjkm@metzlerbros.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Metzler Brothers Systementwicklung GbR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (C) 2005 Patrick Boettcher <patrick.boettcher@posteo.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * Thanks to Twinhan who kindly provided hardware and information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include "vp702x.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /* debug */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) int dvb_usb_vp702x_debug;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) module_param_named(debug,dvb_usb_vp702x_debug, int, 0644);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct vp702x_adapter_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) int pid_filter_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) int pid_filter_can_bypass;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) u8 pid_filter_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) static int vp702x_usb_in_op_unlocked(struct dvb_usb_device *d, u8 req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) u16 value, u16 index, u8 *b, int blen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) ret = usb_control_msg(d->udev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) usb_rcvctrlpipe(d->udev, 0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) USB_TYPE_VENDOR | USB_DIR_IN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) value, index, b, blen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 2000);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) warn("usb in operation failed. (%d)", ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) ret = -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) } else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) deb_xfer("in: req. %02x, val: %04x, ind: %04x, buffer: ",req,value,index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) debug_dump(b,blen,deb_xfer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) u16 index, u8 *b, int blen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) mutex_lock(&d->usb_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) ret = vp702x_usb_in_op_unlocked(d, req, value, index, b, blen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) mutex_unlock(&d->usb_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) static int vp702x_usb_out_op_unlocked(struct dvb_usb_device *d, u8 req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) u16 value, u16 index, u8 *b, int blen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) deb_xfer("out: req. %02x, val: %04x, ind: %04x, buffer: ",req,value,index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) debug_dump(b,blen,deb_xfer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) if ((ret = usb_control_msg(d->udev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) usb_sndctrlpipe(d->udev,0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) USB_TYPE_VENDOR | USB_DIR_OUT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) value,index,b,blen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) 2000)) != blen) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) warn("usb out operation failed. (%d)",ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) } else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) static int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) u16 index, u8 *b, int blen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) mutex_lock(&d->usb_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) ret = vp702x_usb_out_op_unlocked(d, req, value, index, b, blen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) mutex_unlock(&d->usb_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int ilen, int msec)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) if ((ret = mutex_lock_interruptible(&d->usb_mutex)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) ret = vp702x_usb_out_op_unlocked(d, REQUEST_OUT, 0, 0, o, olen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) msleep(msec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) ret = vp702x_usb_in_op_unlocked(d, REQUEST_IN, 0, 0, i, ilen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) mutex_unlock(&d->usb_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) static int vp702x_usb_inout_cmd(struct dvb_usb_device *d, u8 cmd, u8 *o,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) int olen, u8 *i, int ilen, int msec)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) struct vp702x_device_state *st = d->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) u8 *buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) int buflen = max(olen + 2, ilen + 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) ret = mutex_lock_interruptible(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) if (buflen > st->buf_len) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) buf = kmalloc(buflen, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) if (!buf) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) mutex_unlock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) info("successfully reallocated a bigger buffer");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) kfree(st->buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) st->buf = buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) st->buf_len = buflen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) buf = st->buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) buf[0] = 0x00;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) buf[1] = cmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) memcpy(&buf[2], o, olen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) ret = vp702x_usb_inout_op(d, buf, olen+2, buf, ilen+1, msec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) if (ret == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) memcpy(i, &buf[1], ilen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) mutex_unlock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) static int vp702x_set_pld_mode(struct dvb_usb_adapter *adap, u8 bypass)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) struct vp702x_device_state *st = adap->dev->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) u8 *buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) mutex_lock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) buf = st->buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) memset(buf, 0, 16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) ret = vp702x_usb_in_op(adap->dev, 0xe0, (bypass << 8) | 0x0e,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 0, buf, 16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) mutex_unlock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) static int vp702x_set_pld_state(struct dvb_usb_adapter *adap, u8 state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) struct vp702x_device_state *st = adap->dev->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) u8 *buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) mutex_lock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) buf = st->buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) memset(buf, 0, 16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) ret = vp702x_usb_in_op(adap->dev, 0xe0, (state << 8) | 0x0f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 0, buf, 16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) mutex_unlock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) static int vp702x_set_pid(struct dvb_usb_adapter *adap, u16 pid, u8 id, int onoff)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) struct vp702x_adapter_state *st = adap->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) struct vp702x_device_state *dst = adap->dev->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) u8 *buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) if (onoff)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) st->pid_filter_state |= (1 << id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) st->pid_filter_state &= ~(1 << id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) pid = 0xffff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) id = 0x10 + id*2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) vp702x_set_pld_state(adap, st->pid_filter_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) mutex_lock(&dst->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) buf = dst->buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) memset(buf, 0, 16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) vp702x_usb_in_op(adap->dev, 0xe0, (((pid >> 8) & 0xff) << 8) | (id), 0, buf, 16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) vp702x_usb_in_op(adap->dev, 0xe0, (((pid ) & 0xff) << 8) | (id+1), 0, buf, 16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) mutex_unlock(&dst->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) static int vp702x_init_pid_filter(struct dvb_usb_adapter *adap)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) struct vp702x_adapter_state *st = adap->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) struct vp702x_device_state *dst = adap->dev->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) u8 *b;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) st->pid_filter_count = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) st->pid_filter_can_bypass = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) st->pid_filter_state = 0x00;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) vp702x_set_pld_mode(adap, 1); /* bypass */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) for (i = 0; i < st->pid_filter_count; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) vp702x_set_pid(adap, 0xffff, i, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) mutex_lock(&dst->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) b = dst->buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) memset(b, 0, 10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) vp702x_usb_in_op(adap->dev, 0xb5, 3, 0, b, 10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) vp702x_usb_in_op(adap->dev, 0xb5, 0, 0, b, 10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) vp702x_usb_in_op(adap->dev, 0xb5, 1, 0, b, 10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) mutex_unlock(&dst->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) /*vp702x_set_pld_mode(d, 0); // filter */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) static int vp702x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) /* keys for the enclosed remote control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) static struct rc_map_table rc_map_vp702x_table[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) { 0x0001, KEY_1 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) { 0x0002, KEY_2 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) /* remote control stuff (does not work with my box) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) /* remove the following return to enabled remote querying */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) #if 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) u8 *key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) key = kmalloc(10, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) if (!key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) vp702x_usb_in_op(d,READ_REMOTE_REQ,0,0,key,10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) deb_rc("remote query key: %x %d\n",key[1],key[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) if (key[1] == 0x44) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) *state = REMOTE_NO_KEY_PRESSED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) kfree(key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) for (i = 0; i < ARRAY_SIZE(rc_map_vp702x_table); i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) if (rc5_custom(&rc_map_vp702x_table[i]) == key[1]) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) *state = REMOTE_KEY_PRESSED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) *event = rc_map_vp702x_table[i].keycode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) kfree(key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) static int vp702x_read_mac_addr(struct dvb_usb_device *d,u8 mac[6])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) u8 i, *buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) struct vp702x_device_state *st = d->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) mutex_lock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) buf = st->buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) for (i = 6; i < 12; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) ret = vp702x_usb_in_op(d, READ_EEPROM_REQ, i, 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) &buf[i - 6], 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) goto err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) memcpy(mac, buf, 6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) err:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) mutex_unlock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) static int vp702x_frontend_attach(struct dvb_usb_adapter *adap)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) u8 buf[10] = { 0 };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 0, 7, NULL, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) if (vp702x_usb_inout_cmd(adap->dev, GET_SYSTEM_STRING, NULL, 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) buf, 10, 10))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) buf[9] = '\0';
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) info("system string: %s",&buf[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) vp702x_init_pid_filter(adap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) adap->fe_adap[0].fe = vp702x_fe_attach(adap->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 1, 7, NULL, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) static struct dvb_usb_device_properties vp702x_properties;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) static int vp702x_usb_probe(struct usb_interface *intf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) const struct usb_device_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) struct dvb_usb_device *d;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) struct vp702x_device_state *st;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) ret = dvb_usb_device_init(intf, &vp702x_properties,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) THIS_MODULE, &d, adapter_nr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) st = d->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) st->buf_len = 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) st->buf = kmalloc(st->buf_len, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) if (!st->buf) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) ret = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) dvb_usb_device_exit(intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) mutex_init(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) static void vp702x_usb_disconnect(struct usb_interface *intf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) struct dvb_usb_device *d = usb_get_intfdata(intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) struct vp702x_device_state *st = d->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) mutex_lock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) kfree(st->buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) mutex_unlock(&st->buf_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) dvb_usb_device_exit(intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) static struct usb_device_id vp702x_usb_table [] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7021_COLD) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) // { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7020_COLD) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) // { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7020_WARM) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) { 0 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) MODULE_DEVICE_TABLE(usb, vp702x_usb_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) static struct dvb_usb_device_properties vp702x_properties = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) .usb_ctrl = CYPRESS_FX2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) .firmware = "dvb-usb-vp702x-02.fw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) .no_reconnect = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) .size_of_priv = sizeof(struct vp702x_device_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) .num_adapters = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) .adapter = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) .num_frontends = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) .fe = {{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) .caps = DVB_USB_ADAP_RECEIVES_204_BYTE_TS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) .streaming_ctrl = vp702x_streaming_ctrl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) .frontend_attach = vp702x_frontend_attach,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) /* parameter for the MPEG2-data transfer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) .stream = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) .type = USB_BULK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) .count = 10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) .endpoint = 0x02,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) .u = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) .bulk = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) .buffersize = 4096,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) }},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) .size_of_priv = sizeof(struct vp702x_adapter_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) .read_mac_address = vp702x_read_mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) .rc.legacy = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) .rc_map_table = rc_map_vp702x_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) .rc_map_size = ARRAY_SIZE(rc_map_vp702x_table),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) .rc_interval = 400,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) .rc_query = vp702x_rc_query,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) .num_device_descs = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) .devices = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) { .name = "TwinhanDTV StarBox DVB-S USB2.0 (VP7021)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) .cold_ids = { &vp702x_usb_table[0], NULL },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) .warm_ids = { NULL },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) /* { .name = "TwinhanDTV StarBox DVB-S USB2.0 (VP7020)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) .cold_ids = { &vp702x_usb_table[2], NULL },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) .warm_ids = { &vp702x_usb_table[3], NULL },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) */ { NULL },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) /* usb specific object needed to register this driver with the usb subsystem */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) static struct usb_driver vp702x_usb_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) .name = "dvb_usb_vp702x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) .probe = vp702x_usb_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) .disconnect = vp702x_usb_disconnect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) .id_table = vp702x_usb_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) module_usb_driver(vp702x_usb_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@posteo.de>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) MODULE_DESCRIPTION("Driver for Twinhan StarBox DVB-S USB2.0 and clones");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) MODULE_VERSION("1.0");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) MODULE_LICENSE("GPL");