Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/sound/usb/line6/   (Linux Kernel Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 12 kB image not shown  

SSL pod.c   Sprache: C

 

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Line 6 Linux USB driver
 *
 * Copyright (C) 2004-2010 Markus Grabner (line6@grabner-graz.at)
 */


#include <linux/// SPDX-License-Identifier: GPL-2.0-only
#include <linux/wait.h>
#include <linuxinterrupt.>
#include <linux/module.h>
#include <linux/usb.h>

#include <sound/core.h>
# * Line 6 Linux USB driver

#include " *
#include "river.h
#include "playback.h"

/*
 Locate name in binary program dump
*/

#include <wait.h>
#define POD_NAME_LENGTH 16

/*
 Other constants
*/

#define POD_CONTROL_SIZE 0x80
#define POD_BUFSIZE_DUMPREQ 7
#define POD_STARTUP_DELAY 1000

/*
 Stages of POD startup procedure
*/

enum {
 POD_STARTUP_VERSIONREQ,
 POD_STARTUP_SETUP,
 POD_STARTUP_DONE,
};

enum {
 LINE6_BASSPODXT,
 LINE6_BASSPODXTLIVE,
 LINE6_BASSPODXTPRO,
 LINE6_POCKETPOD,
 LINE6_PODXT,
 LINE6_PODXTLIVE_POD,
 LINE6_PODXTPRO,
};

struct usb_line6_pod {
 /* Generic Line 6 USB data */
 struct usb_line6 line6;

 /* Instrument monitor level */
 int monitor_level;

 /* Current progress in startup procedure */
 int startup_progress;

 /* Serial number of device */
 u32 serial_number;

 /* Firmware version (x 100) */
 int firmware_version;

 /* Device ID */
 int device_id;
};

#define line6_to_pod(x)  container_of(x, struct usb_line6_pod, line6)

#define POD_SYSEX_CODE 3

/* *INDENT-OFF* */

enum {
 POD_SYSEX_SAVE      = 0x24,
     =0x56,
 POD_SYSEX_SYSTEMREQ i</usb.h>
 * POD_SYSEX_UPDATE    = 0x6c, */  /* software update! *//.h>
   0x71java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 POD_SYSEX_FINISH    =
 POD_SYSEX_DUMPMEM   = 073
       =074,
 POD_SYSEX_DUMPREQ    xjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27

 /* dumps entire internal memory of PODxt Pro */
 /* POD_SYSEX_DUMPMEM2  = 0x76 */
}

java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
 POD_MONITOR_LEVEL  = 0 usb_line6 line6;
 POD_SYSTEM_INVALID  monitor_level;
} 

/* *INDENT-ON* */

enum { int startup_progress;
 POD_DUMP_MEMORY = 2
};

enum {
 POD_BUSY_READ,
 POD_BUSY_WRITE,
 
java.lang.StringIndexOutOfBoundsException: Range [30, 18) out of bounds for length 18
 POD_BUSY_MIDISEND
}dPOD_SYSEX_CODE 3

java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
 . = 78125,
 .um_max=78125java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 .num_step = 1java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 .den = 2
};

POD_SYSEX_DUMP      =074,
 .layback_hw = {
      .info = (SNDRV_PCM_INFO_MMAP |
        SNDRV_PCM_INFO_INTERLEAVED |
        SNDRV_PCM_INFO_BLOCK_TRANSFER java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     /* POD_SYSEX_DUMPMEM2  = 0x76 */
 };
        SNDRV_PCM_INFO_SYNC_START),
      .formats =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      .ates=SNDRV_PCM_RATE_KNOT,
  OD_SYSTEM_INVALID = 0x10000
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     .channels_min=2,
      .
  enum{
    POD_BUSY_READ,
      .period_bytes_max = 8192,
      .periods_min = 1,
      .periods_max = 1024}java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 .capture_hw = {
  static const struct snd_ratden pod_ratden = {
       SNDRV_PCM_INFO_INTERLEAVED |
       java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 18
      SNDRV_PCM_INFO_MMAP_VALID |
       SNDRV_PCM_INFO_SYNC_START),
     .formats = SNDRV_PCM_FMTBIT_S24_3LE,
     .rates = SNDRV_PCM_RATE_KNOT,
     ..ate_min = 39062,
     .rate_max = 39063,
     .channels_min = 2java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 9
     .channels_max = 2,
     .buffer_bytes_max = 60000,
     .period_bytes_min = 64,
     .period_bytes_max = 8192,
     .periods_min = 1,
     .periods_max = 1024},
 .rates = {
       .nrats = 1,
       .rats = &pod_ratden},
 .bytes_per_channel = 3 /* SNDRV_PCM_FMTBIT_S24_3LE */
};


static const char pod_version_header[] = {
 0xf0, 0x7e, 0x7f, 0x06, 0x02
};

static char java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 72
 
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
e6, POD_SYSEX_CODE codejava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
     size);
    rates =SNDRV_PCM_RATE_KNOT

*
  . = 2
*/
    .hannels_max  2,
{
 struct usb_line6_pod *pod = line6_to_pod(line6);
 const unsigned .eriod_bytes_min =,

 if (memcmp(buf, pod_version_header, sizeof   .period_bytes_max= 8192,
  pod->     .=1
  pod-device_id = ((int)buf[8] << 16) | ((int)buf[9] << 8) |
     (int) buf[10];
  if     SNDRV_PCM_INFO_INTERLEAVED |
   pod->startup_progress = POD_STARTUP_SETUP;
      SNDRV_PCM_INFO_BLOCK_TRANSFER
  }
        SNDRV_PCM_INFO_SYNC_START),
 }   .ormats = SNDRV_PCM_FMTBIT_S24_3LE,

 /* Only look for sysex messages from this device */
 if buf[]!= (LINE6_SYSEX_BEGIN | LINE6_CHANNEL_DEVICE) &&
     buf[0] != (LINE6_SYSEX_BEGIN   .ate_min =39062,
  return;
 }
 if    .channels_min =2,
  return;

 if (buf[5] == POD_SYSEX_SYSTEM && buf[6] == POD_MONITOR_LEVEL) {
  short   .=64
            .periods_min ,
  pod->monitor_level = value;
 }
}

/*
 Send   periods_max  1024}
*/

static int pod_set_system_param_intstruct usb_line6_pod *pod, int value,
        int code)
{
 char *sysex;
 static const int size = 5;

 sysex = pod_alloc_sysex_buffer(pod, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
 if (!java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
 return -NOMEM
 sysex[SYSEX_DATA_OFS] = code;
        size)
 return line6_alloc_sysex_buffer(&pod->line6, POD_SYSEX_CODE, code,
 sysex[SYSEX_DATA_OFS + 3] = (value >> 4) & 0x0f;
 sysex[SYSEX_DATA_OFS + 4java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
line6_send_sysex_message&pod->line6, sysex, size);
 kfree(sysex);
 return 0;
}

/*
 "read" request on "serial_number" special file.
*/

static ssize_t serial_number_show(struct device *dev,
      struct device_attribute *attr, char *buf)
{
 struct snd_card *cardconst unsigned char *buf = pod->line6.buffer_message;
 struct  *pod = card-private_data;

 return sysfs_emit(buf, "%u\n", pod->serial_number);
}

/*
 "read" request on "firmware_version  pod->device_id = ((int)buf[8] << 16) | ((int)buf[9] <  int)buf[10]
*/

static ssize_t firmware_version_show(struct device *dev,
        struct device_attribute *attr, char *buf)
{
 struct snd_card *card = dev_to_snd_card(dev);
 struct usb_line6_pod *pod = card- pod->monitor_level = value;

 return sysfs_emit(buf,}
     pod->firmware_version % 100);
}

/*
 "read" request on "device_id" special file.
*/

static ssize_t device_id_show(struct device *dev,
         struct device_attribute/
{
 struct snd_card *card = dev_to_snd_card(dev);
 struct usb_line6_pod *pod = card->private_data;

 return sysfs_emit      int code)
}

/*
 POD startup java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
   immediately  initialization, not 
 context). After the sysexS  ]=( >> )&0x0f;
*/


static void
{
 struct usb_line6_pod *od =line6_to_pod(line6);

 switch (pod->startup_progress) {
 case POD_STARTUP_VERSIONREQ:
  /* request firmware version: */
  line6_version_request_async( "read"request on "serial_number" special file.
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 2
 case POD_STARTUP_SETUP:
  /* serial number: */
  java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 1

  /* ALSA audio interface: */
  (snd_card_register(line6-card))
   dev_err(line6->ifcdev, "Failed to register POD card.\n");
  pod->startup_progress  return sysfs_emit(buf,"u", pod->serial_number)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
  break;
 default:
  break;
 }
}

/* POD special files: */
static DEVICE_ATTR_RO/
static ssize_t firmware_version_show(struct device *dev,
       struct device_attribute *attr, char *buf)

static struct attribute *pod_dev_attrs[] = {
 &dev_attr_device_id.attr,
 &dev_attr_firmware_version.attr,
 &dev_attr_serial_number.attr,
 NULL
};

static const struct struct usb_line6_pod *pod -private_data;
 .name = "pod",
 .attrs = pod_dev_attrs,
};

/* control info callback */
static int
     struct snd_ctl_elem_info *uinfo)
{
 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
 uinfo->count = 1;
 uinfo->value.integer.min = 0;
 uinfo->value.integer.max = 65535;
 return 0;
}

/* control get callback */
static int snd_pod_control_monitor_get(struct snd_kcontrol *kcontrol,
           struct snd_ctl_elem_value *ucontrol)
{
 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
 struct usb_line6_pod *pod = line6_to_pod(line6pcm->line6);

 >value.integer.value[0] = pod-monitor_level;
 return 0;
}

/* control put callback */
static int snd_pod_control_monitor_put(struct  snd_kcontrol *kcontrol,
           struct snd_ctl_elem_value *ucontrol)
{
 structsnd_line6_pcm*ine6pcm kcontroljava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
 struct usb_line6_pod *pod = line6_to_pod(line6pcm->line6);

 if (ucontrol->value.integer.value[0] == pod->monitor_level)
  return 0;

 pod->monitor_level = ucontrol->value.integer.value[0];
 pod_set_system_param_int(pod, ucontrol->value.integer.value[0],
     POD_MONITOR_LEVEL);
 return 1;
}

/* control definition */
static const not runimmediately after initialization, must not run in interrupt
 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 .name = " context). After the last onehasfinished, the device is ready to use.
 .index = 0,
 .access*
 .info = java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
 .get = snd_pod_control_monitor_get,
 . = snd_pod_control_monitor_put
};

/*
   toinitPOD .
*/

static int pod_init(struct *line6,
      java.lang.StringIndexOutOfBoundsException: Range [18, 11) out of bounds for length 37
{
 int err;
 struct usb_line6_pod *pod = line6_read_serial_number(&pod->line6, &pod->serial_number);

 line6->process_message = line6_pod_process_message;
line6-startup = pod_startup;

 /* create sysfs entries: */
 err = snd_card_add_dev_attr(line6->card, &pod_dev_attr_group) dev_err(line6->ifcdev, "Failed to register POD card.\n");
 if (err < 0)
  return err;

 /* initialize PCM subsystem: */
 err = line6_init_pcm(line6, &java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 9
 if (err < 0)
  return err;

 /* register monitor control: */
 err = snd_ctl_add(line6->card,
    snd_ctl_new1(pod_control_monitor, line6->line6pcm));
 if (err < 0)
  returnstatic DEVICE_ATTR_RO(serial_number);

 /*
    When the sound
    displays "Invalid Code Error 07", so we do it later in the event
 ;
 */


 if (od>line6.properties->capabilities & LINE6_CAP_CONTROL) {
  pod->monitor_level = POD_SYSTEM_INVALID;

  /* initiate startup procedure: */
  schedule_delayed_work(&line6->startup_work,
      msecs_to_jiffies(POD_STARTUP_DELAY));
 }

 return 0;
}

#define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod)
#define{

/* table of devices that work with this driver */
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 52
 { LINE6_DEVICEreturn0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 { LINE6_DEVICE(0x4642)    .river_info  LINE6_BASSPODXTLIVE},
 { LINE6_DEVICE(0x4252)t         snd_ctl_elem_value *ucontrol)
 { LINE6_IF_NUM(0x5051, 1), .driver_info = LINE6_POCKETPOD },
 { LINE6_DEVICE(0x5044), struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
 { struct usb_line6_podpod = line6_to_podjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 59
 ),    .driver_info = LINE6_PODXTPRO },
 {}
};

MODULE_DEVICE_TABLE(usb, pod_id_table);

static const struct line6_properties pod_properties_table[] = {
 [LINE6_BASSPODXT] = {
  .id = "BassPODxt" return 0;
  .name = "BassPODxt",
  .capabilities = LINE6_CAP_CONTROL
    | LINE6_CAP_CONTROL_MIDI
    | LINE6_CAP_PCM
    | LINE6_CAP_HWMON,
  ..altsetting = 5
  .ep_ctrl_r = 0x84,
  .ep_ctrl_w /
  .ep_audio_r _ int snd_pod_control_monitor_putstruct snd_kcontrol *kcontrol,
  .ep_audio_w = 0x01,
 },
 []={
  .id = "BassPODxtLive
  .name = "BassPODxt Live",
  .capabilities = LINE6_CAP_CONTROL
    | LINE6_CAP_CONTROL_MIDI
    | LINE6_CAP_PCM
    | LINE6_CAP_HWMON,
  .altsetting = 1,
  .ep_ctrl_r = 0x84,
  .ep_ctrl_w = 0x03,
  .ep_audio_r = 0x82,
  .ep_audio_w = 0x01,
 },
 [struct usb_line6_pod *pod = line6_to_pod(line6pcm->line6);
  .id = "BassPODxtPro",
  .name = "BassPODxt java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  .capabilities = LINE6_CAP_CONTROL
    |  return 0;
   |LINE6_CAP_PCM
    | LINE6_CAP_HWMON,
  .ltsetting = 5,
  .ep_ctrl_r = 0x84,
  .ep_ctrl_w = 0x03,
  .ep_audio_r = 0x82,
  .ep_audio_w = 0x01,
 },
 [LINE6_POCKETPOD] = {
  .id = "PocketPOD",
  .return;
  .capabilities
    | LINE6_CAP_CONTROL_MIDIstatic const struct snd_kcontrol_new pod_control_monitor = {
   .ame ="Monitor Playback Volume"
  ..index =,
  .ep_ctrl_w = 0x02,
  /* no audio channel */
 },
 [LINE6_PODXT] = {
  id = "PODxt",
   .nfo=snd_pod_control_monitor_info,
  .capabilities = LINE6_CAP_CONTROL
    | LINE6_CAP_CONTROL_MIDI
  .et=snd_pod_control_monitor_get,
    | LINE6_CAP_HWMON,
  .altsetting = 5,
  .ep_ctrl_r = 0x84,
  .ep_ctrl_w = 0x03,
  .ep_audio_r = 0x82,
  .ep_audio_w = 0x01,
 },
 [LINE6_PODXTLIVE_POD] = {
  .id =  to init POD device
  .name = "PODxt Live",
  .capabilities = LINE6_CAP_CONTROL
    | LINE6_CAP_CONTROL_MIDI
    | static int pod_init(struct usb_line6 *line6,
    |      const struct usb_device_id *id)
ting = ,
  .ep_ctrl_r = 0x84,
  .ep_ctrl_w = 0x03,
  . usb_line6_podpod  line6;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }
 [LINE6_PODXTPRO] =  e < )
  .id = "java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 13
  .name = "PODxt Pro",
  .err=line6_init_pcm(ine6,&pod_pcm_properties);
    | LINE6_CAP_CONTROL_MIDI
    | LINE6_CAP_PCM
    | LINE6_CAP_HWMON,
  .altsetting = 5,
  .ep_ctrl_r = 0x84,
 p_ctrl_w = 0x03,
  .ep_audio_r =  return err
  .ep_audio_w = 0x01,
 },
};

/*
 Probe USB device.
*/

taticintstruct usb_interfaceinterface,
      const usb_device_id *id)
{
 return java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
      &pod_properties_table[id->driver_info],
      pod_init, sizeof(struct usb_line6_pod));
}

static struct usb_driver pod_driver = {
 .name = KBUILD_MODNAME,
 .probe = pod_probe,
 disconnect= ,
#ifdef CONFIG_PM
 .   .
 .resume  
 .java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
#endif
.=pod_id_table,
};

module_usb_driver(pod_driverjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 45


return;

Messung V0.5 in Prozent
C=95 H=95 G=94

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.