• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/line6/

Lines Matching refs:this

29 			the "Song Position Pointer", but this is used by Line6
38 void midibuf_reset(struct MidiBuffer *this)
40 this->pos_read = this->pos_write = this->full = 0;
41 this->command_prev = -1;
44 int midibuf_init(struct MidiBuffer *this, int size, int split)
46 this->buf = kmalloc(size, GFP_KERNEL);
48 if (this->buf == NULL)
51 this->size = size;
52 this->split = split;
53 midibuf_reset(this);
57 void midibuf_status(struct MidiBuffer *this)
60 "full=%d command_prev=%02x\n", this->size, this->split,
61 this->pos_read, this->pos_write, this->full, this->command_prev);
64 static int midibuf_is_empty(struct MidiBuffer *this)
66 return (this->pos_read == this->pos_write) && !this->full;
69 static int midibuf_is_full(struct MidiBuffer *this)
71 return this->full;
74 int midibuf_bytes_free(struct MidiBuffer *this)
77 midibuf_is_full(this) ?
79 (this->pos_read - this->pos_write + this->size - 1) % this->size + 1;
82 int midibuf_bytes_used(struct MidiBuffer *this)
85 midibuf_is_empty(this) ?
87 (this->pos_write - this->pos_read + this->size - 1) % this->size + 1;
90 int midibuf_write(struct MidiBuffer *this, unsigned char *data, int length)
96 if (midibuf_is_full(this) || (length <= 0))
105 bytes_free = midibuf_bytes_free(this);
111 length1 = this->size - this->pos_write;
115 memcpy(this->buf + this->pos_write, data, length);
116 this->pos_write += length;
120 memcpy(this->buf + this->pos_write, data, length1);
121 memcpy(this->buf, data + length1, length2);
122 this->pos_write = length2;
125 if (this->pos_write == this->pos_read)
126 this->full = 1;
132 int midibuf_read(struct MidiBuffer *this, unsigned char *data, int length)
145 if (midibuf_is_empty(this))
148 bytes_used = midibuf_bytes_used(this);
153 length1 = this->size - this->pos_read;
156 command = this->buf[this->pos_read];
160 this->command_prev = command;
162 if (this->command_prev > 0) {
163 int midi_length_prev = midibuf_message_length(this->command_prev);
179 if (this->buf[this->pos_read + i] & 0x80)
188 if (this->buf[this->pos_read + i] & 0x80)
195 if (this->buf[i] & 0x80)
207 if (!this->split)
218 memcpy(data + repeat, this->buf + this->pos_read, length);
219 this->pos_read += length;
223 memcpy(data + repeat, this->buf + this->pos_read, length1);
224 memcpy(data + repeat + length1, this->buf, length2);
225 this->pos_read = length2;
229 data[0] = this->command_prev;
231 this->full = 0;
235 int midibuf_ignore(struct MidiBuffer *this, int length)
237 int bytes_used = midibuf_bytes_used(this);
242 this->pos_read = (this->pos_read + length) % this->size;
243 this->full = 0;
247 int midibuf_skip_message(struct MidiBuffer *this, unsigned short mask)
249 int cmd = this->command_prev;
258 void midibuf_destroy(struct MidiBuffer *this)
260 kfree(this->buf);
261 this->buf = NULL;