staging: unisys: visorchannel: Make visorchannel_create take a gfp_t
[linux-2.6-block.git] / drivers / staging / unisys / common-spar / include / channels / controlvmchannel.h
CommitLineData
f6d0c1e6 1/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
12e364b9
KC
2 * All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at
7 * your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12 * NON INFRINGEMENT. See the GNU General Public License for more
13 * details.
14 */
15
16#ifndef __CONTROLVMCHANNEL_H__
17#define __CONTROLVMCHANNEL_H__
18
90addb02 19#include <linux/uuid.h>
12e364b9
KC
20#include "channel.h"
21#include "controlframework.h"
af96e9c0 22
12e364b9 23/* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
5fbaa4b3 24#define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID \
90addb02 25 UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
7e5a1a76 26 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
12e364b9 27
12e364b9
KC
28#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
29 ULTRA_CHANNEL_PROTOCOL_SIGNATURE
7e5a1a76 30#define CONTROLVM_MESSAGE_MAX 64
12e364b9
KC
31
32/* Must increment this whenever you insert or delete fields within
7e5a1a76
EA
33 * this channel struct. Also increment whenever you change the meaning
34 * of fields within this channel struct so as to break pre-existing
35 * software. Note that you can usually add fields to the END of the
36 * channel struct withOUT needing to increment this.
37 */
12e364b9
KC
38#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1
39
600832fd
BR
40#define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
41 spar_check_channel_client(ch, \
df94247a 42 SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID, \
d19642f6
BR
43 "controlvm", \
44 sizeof(struct spar_controlvm_channel_protocol), \
45 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
46 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE)
12e364b9 47
12e364b9
KC
48#define MAX_SERIAL_NUM 32
49
7e5a1a76 50/* Defines for various channel queues */
12e364b9
KC
51#define CONTROLVM_QUEUE_REQUEST 0
52#define CONTROLVM_QUEUE_RESPONSE 1
7e5a1a76 53#define CONTROLVM_QUEUE_EVENT 2
12e364b9
KC
54#define CONTROLVM_QUEUE_ACK 3
55
7e5a1a76 56/* Max num of messages stored during IOVM creation to be reused after crash */
12e364b9
KC
57#define CONTROLVM_CRASHMSG_MAX 2
58
7e5a1a76 59/* Ids for commands that may appear in either queue of a ControlVm channel.
12e364b9
KC
60 *
61 * Commands that are initiated by the command partition (CP), by an IO or
62 * console service partition (SP), or by a guest partition (GP)are:
63 * - issued on the RequestQueue queue (q #0) in the ControlVm channel
64 * - responded to on the ResponseQueue queue (q #1) in the ControlVm channel
65 *
66 * Events that are initiated by an IO or console service partition (SP) or
67 * by a guest partition (GP) are:
68 * - issued on the EventQueue queue (q #2) in the ControlVm channel
69 * - responded to on the EventAckQueue queue (q #3) in the ControlVm channel
70 */
53bebb13 71enum controlvm_id {
12e364b9 72 CONTROLVM_INVALID = 0,
7e5a1a76
EA
73 /* SWITCH commands required Parameter: SwitchNumber */
74 /* BUS commands required Parameter: BusNumber */
75 CONTROLVM_BUS_CREATE = 0x101, /* CP --> SP, GP */
76 CONTROLVM_BUS_DESTROY = 0x102, /* CP --> SP, GP */
77 CONTROLVM_BUS_CONFIGURE = 0x104, /* CP --> SP */
78 CONTROLVM_BUS_CHANGESTATE = 0x105, /* CP --> SP, GP */
79 CONTROLVM_BUS_CHANGESTATE_EVENT = 0x106, /* SP, GP --> CP */
80/* DEVICE commands required Parameter: BusNumber, DeviceNumber */
81
82 CONTROLVM_DEVICE_CREATE = 0x201, /* CP --> SP, GP */
83 CONTROLVM_DEVICE_DESTROY = 0x202, /* CP --> SP, GP */
84 CONTROLVM_DEVICE_CONFIGURE = 0x203, /* CP --> SP */
85 CONTROLVM_DEVICE_CHANGESTATE = 0x204, /* CP --> SP, GP */
86 CONTROLVM_DEVICE_CHANGESTATE_EVENT = 0x205, /* SP, GP --> CP */
87 CONTROLVM_DEVICE_RECONFIGURE = 0x206, /* CP --> Boot */
12e364b9 88/* CHIPSET commands */
7e5a1a76
EA
89 CONTROLVM_CHIPSET_INIT = 0x301, /* CP --> SP, GP */
90 CONTROLVM_CHIPSET_STOP = 0x302, /* CP --> SP, GP */
7e5a1a76
EA
91 CONTROLVM_CHIPSET_READY = 0x304, /* CP --> SP */
92 CONTROLVM_CHIPSET_SELFTEST = 0x305, /* CP --> SP */
12e364b9 93
d8ad8b0c 94};
12e364b9 95
4eddbf13 96struct irq_info {
22a0350b 97 u64 reserved1;
12e364b9 98
7e5a1a76 99 /* specifies interrupt handle. It is used to retrieve the
12e364b9
KC
100 * corresponding interrupt pin from Monitor; and the
101 * interrupt pin is used to connect to the corresponding
7e5a1a76
EA
102 * interrupt. Used by IOPart-GP only.
103 */
af3286bd 104 u64 recv_irq_handle;
12e364b9 105
7e5a1a76 106 /* specifies interrupt vector. It, interrupt pin, and shared are
12e364b9 107 * used to connect to the corresponding interrupt. Used by
7e5a1a76
EA
108 * IOPart-GP only.
109 */
af3286bd 110 u32 recv_irq_vector;
12e364b9 111
7e5a1a76
EA
112 /* specifies if the recvInterrupt is shared. It, interrupt pin
113 * and vector are used to connect to 0 = not shared; 1 = shared.
114 * the corresponding interrupt. Used by IOPart-GP only.
115 */
af3286bd 116 u8 recv_irq_shared;
c242233e 117 u8 reserved[3]; /* Natural alignment purposes */
12e364b9
KC
118};
119
c12ad837 120struct pci_id {
6822f736
BR
121 u16 domain;
122 u8 bus;
123 u8 slot;
124 u8 func;
125 u8 reserved[3]; /* Natural alignment purposes */
12e364b9
KC
126};
127
755e2ecc 128struct efi_spar_indication {
7e5a1a76
EA
129 u64 boot_to_fw_ui:1; /* Bit 0: Stop in uefi ui */
130 u64 clear_nvram:1; /* Bit 1: Clear NVRAM */
131 u64 clear_cmos:1; /* Bit 2: Clear CMOS */
132 u64 boot_to_tool:1; /* Bit 3: Run install tool */
12e364b9 133 /* remaining bits are available */
755e2ecc 134};
12e364b9 135
b9b141e8 136enum ultra_chipset_feature {
12e364b9
KC
137 ULTRA_CHIPSET_FEATURE_REPLY = 0x00000001,
138 ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG = 0x00000002,
b9b141e8 139};
12e364b9 140
7e5a1a76 141/* This is the common structure that is at the beginning of every
12e364b9
KC
142 * ControlVm message (both commands and responses) in any ControlVm
143 * queue. Commands are easily distinguished from responses by
144 * looking at the flags.response field.
145 */
98d7b594
BR
146struct controlvm_message_header {
147 u32 id; /* See CONTROLVM_ID. */
12e364b9
KC
148 /* For requests, indicates the message type. */
149 /* For responses, indicates the type of message we are responding to. */
150
98d7b594 151 u32 message_size; /* Includes size of this struct + size
12e364b9 152 * of message */
98d7b594 153 u32 segment_index; /* Index of segment containing Vm
12e364b9 154 * message/information */
98d7b594 155 u32 completion_status; /* Error status code or result of
12e364b9
KC
156 * message completion */
157 struct {
7e5a1a76 158 u32 failed:1; /* =1 in a response to * signify
12e364b9 159 * failure */
7e5a1a76
EA
160 u32 response_expected:1; /* =1 in all messages that expect a
161 * response (Control ignores this
162 * bit) */
163 u32 server:1; /* =1 in all bus & device-related
12e364b9
KC
164 * messages where the message
165 * receiver is to act as the bus or
166 * device server */
7e5a1a76 167 u32 test_message:1; /* =1 for testing use only
12e364b9
KC
168 * (Control and Command ignore this
169 * bit) */
7e5a1a76
EA
170 u32 partial_completion:1; /* =1 if there are forthcoming
171 * responses/acks associated
172 * with this message */
173 u32 preserve:1; /* =1 this is to let us know to
174 * preserve channel contents
175 * (for running guests)*/
176 u32 writer_in_diag:1; /* =1 the DiagWriter is active in the
177 * Diagnostic Partition*/
98d7b594
BR
178 } flags;
179 u32 reserved; /* Natural alignment */
180 u64 message_handle; /* Identifies the particular message instance,
12e364b9
KC
181 * and is used to match particular */
182 /* request instances with the corresponding response instance. */
98d7b594 183 u64 payload_vm_offset; /* Offset of payload area from start of this
12e364b9 184 * instance of ControlVm segment */
98d7b594 185 u32 payload_max_bytes; /* Maximum bytes allocated in payload
12e364b9 186 * area of ControlVm segment */
98d7b594 187 u32 payload_bytes; /* Actual number of bytes of payload
12e364b9
KC
188 * area to copy between IO/Command; */
189 /* if non-zero, there is a payload to copy. */
98d7b594 190};
12e364b9 191
f91b9262 192struct controlvm_packet_device_create {
7e5a1a76
EA
193 u32 bus_no; /* bus # (0..n-1) from the msg receiver's end */
194 u32 dev_no; /* bus-relative (0..n-1) device number */
f91b9262
BR
195 u64 channel_addr; /* Guest physical address of the channel, which
196 * can be dereferenced by the receiver of this
197 * ControlVm command */
198 u64 channel_bytes; /* specifies size of the channel in bytes */
199 uuid_le data_type_uuid; /* specifies format of data in channel */
200 uuid_le dev_inst_uuid; /* instance guid for the device */
201 struct irq_info intr; /* specifies interrupt information */
202}; /* for CONTROLVM_DEVICE_CREATE */
12e364b9 203
e6ad00bb 204struct controlvm_packet_device_configure {
7e5a1a76 205 u32 bus_no; /* bus # (0..n-1) from the msg
12e364b9 206 * receiver's perspective */
7e5a1a76
EA
207 /* Control uses header SegmentIndex field to access bus number... */
208 u32 dev_no; /* bus-relative (0..n-1) device number */
e6ad00bb 209} ; /* for CONTROLVM_DEVICE_CONFIGURE */
12e364b9 210
c36acb55
BR
211struct controlvm_message_device_create {
212 struct controlvm_message_header header;
213 struct controlvm_packet_device_create packet;
214}; /* total 128 bytes */
12e364b9 215
f676054d
BR
216struct controlvm_message_device_configure {
217 struct controlvm_message_header header;
218 struct controlvm_packet_device_configure packet;
219}; /* total 56 bytes */
12e364b9
KC
220
221/* This is the format for a message in any ControlVm queue. */
2ea5117b 222struct controlvm_message_packet {
12e364b9 223 union {
12e364b9 224 struct {
2ea5117b
BR
225 u32 bus_no; /* bus # (0..n-1) from the msg
226 * receiver's perspective */
227 u32 dev_count; /* indicates the max number of
228 * devices on this bus */
229 u64 channel_addr; /* Guest physical address of
230 * the channel, which can be
231 * dereferenced by the receiver
232 * of this ControlVm command */
233 u64 channel_bytes; /* size of the channel */
234 uuid_le bus_data_type_uuid; /* indicates format of
235 * data in bus channel*/
236 uuid_le bus_inst_uuid; /* instance uuid for the bus */
237 } create_bus; /* for CONTROLVM_BUS_CREATE */
12e364b9 238 struct {
2ea5117b
BR
239 u32 bus_no; /* bus # (0..n-1) from the msg
240 * receiver's perspective */
b3c55b13 241 u32 reserved; /* Natural alignment purposes */
2ea5117b 242 } destroy_bus; /* for CONTROLVM_BUS_DESTROY */
12e364b9 243 struct {
2ea5117b
BR
244 u32 bus_no; /* bus # (0..n-1) from the receiver's
245 * perspective */
246 u32 reserved1; /* for alignment purposes */
247 u64 guest_handle; /* This is used to convert
248 * guest physical address to
249 * physical address */
250 u64 recv_bus_irq_handle;
251 /* specifies interrupt info. It is used by SP
252 * to register to receive interrupts from the
253 * CP. This interrupt is used for bus level
254 * notifications. The corresponding
255 * sendBusInterruptHandle is kept in CP. */
256 } configure_bus; /* for CONTROLVM_BUS_CONFIGURE */
12e364b9 257 /* for CONTROLVM_DEVICE_CREATE */
f91b9262 258 struct controlvm_packet_device_create create_device;
12e364b9 259 struct {
2ea5117b
BR
260 u32 bus_no; /* bus # (0..n-1) from the msg
261 * receiver's perspective */
262 u32 dev_no; /* bus-relative (0..n-1) device # */
263 } destroy_device; /* for CONTROLVM_DEVICE_DESTROY */
12e364b9 264 /* for CONTROLVM_DEVICE_CONFIGURE */
e6ad00bb 265 struct controlvm_packet_device_configure configure_device;
12e364b9 266 struct {
2ea5117b
BR
267 u32 bus_no; /* bus # (0..n-1) from the msg
268 * receiver's perspective */
269 u32 dev_no; /* bus-relative (0..n-1) device # */
270 } reconfigure_device; /* for CONTROLVM_DEVICE_RECONFIGURE */
12e364b9 271 struct {
2ea5117b 272 u32 bus_no;
3f833b54 273 struct spar_segment_state state;
c242233e 274 u8 reserved[2]; /* Natural alignment purposes */
2ea5117b 275 } bus_change_state; /* for CONTROLVM_BUS_CHANGESTATE */
12e364b9 276 struct {
2ea5117b
BR
277 u32 bus_no;
278 u32 dev_no;
3f833b54 279 struct spar_segment_state state;
12e364b9 280 struct {
2ea5117b 281 u32 phys_device:1; /* =1 if message is for
12e364b9 282 * a physical device */
12e364b9 283 } flags;
c242233e 284 u8 reserved[2]; /* Natural alignment purposes */
2ea5117b 285 } device_change_state; /* for CONTROLVM_DEVICE_CHANGESTATE */
12e364b9 286 struct {
2ea5117b
BR
287 u32 bus_no;
288 u32 dev_no;
3f833b54 289 struct spar_segment_state state;
c242233e 290 u8 reserved[6]; /* Natural alignment purposes */
2ea5117b
BR
291 } device_change_state_event;
292 /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
12e364b9 293 struct {
2ea5117b
BR
294 u32 bus_count; /* indicates the max number of busses */
295 u32 switch_count; /* indicates the max number of
296 * switches if a service partition */
b9b141e8 297 enum ultra_chipset_feature features;
2ea5117b
BR
298 u32 platform_number; /* Platform Number */
299 } init_chipset; /* for CONTROLVM_CHIPSET_INIT */
12e364b9 300 struct {
2ea5117b
BR
301 u32 options; /* reserved */
302 u32 test; /* bit 0 set to run embedded selftest */
303 } chipset_selftest; /* for CONTROLVM_CHIPSET_SELFTEST */
304 u64 addr; /* a physical address of something, that can be
305 * dereferenced by the receiver of this
306 * ControlVm command (depends on command id) */
307 u64 handle; /* a handle of something (depends on command
308 * id) */
12e364b9 309 };
2ea5117b 310};
12e364b9
KC
311
312/* All messages in any ControlVm queue have this layout. */
3ab47701 313struct controlvm_message {
98d7b594 314 struct controlvm_message_header hdr;
2ea5117b 315 struct controlvm_message_packet cmd;
3ab47701 316};
12e364b9 317
d19642f6 318struct spar_controlvm_channel_protocol {
7e5a1a76
EA
319 struct channel_header header;
320 u64 gp_controlvm; /* guest phys addr of this channel */
321 u64 gp_partition_tables;/* guest phys addr of partition tables */
322 u64 gp_diag_guest; /* guest phys addr of diagnostic channel */
323 u64 gp_boot_romdisk;/* guest phys addr of (read* only) Boot ROM disk */
324 u64 gp_boot_ramdisk;/* guest phys addr of writable Boot RAM disk */
325 u64 gp_acpi_table; /* guest phys addr of acpi table */
326 u64 gp_control_channel;/* guest phys addr of control channel */
327 u64 gp_diag_romdisk;/* guest phys addr of diagnostic ROM disk */
328 u64 gp_nvram; /* guest phys addr of NVRAM channel */
329 u64 request_payload_offset; /* Offset to request payload area */
330 u64 event_payload_offset; /* Offset to event payload area */
331 u32 request_payload_bytes; /* Bytes available in request payload
12e364b9 332 * area */
7e5a1a76
EA
333 u32 event_payload_bytes;/* Bytes available in event payload area */
334 u32 control_channel_bytes;
335 u32 nvram_channel_bytes; /* Bytes in PartitionNvram segment */
336 u32 message_bytes; /* sizeof(CONTROLVM_MESSAGE) */
337 u32 message_count; /* CONTROLVM_MESSAGE_MAX */
338 u64 gp_smbios_table; /* guest phys addr of SMBIOS tables */
339 u64 gp_physical_smbios_table; /* guest phys addr of SMBIOS table */
340 /* ULTRA_MAX_GUESTS_PER_SERVICE */
680385e3 341 char gp_reserved[2688];
7e5a1a76
EA
342
343 /* guest physical address of EFI firmware image base */
344 u64 virtual_guest_firmware_image_base;
345
346 /* guest physical address of EFI firmware entry point */
347 u64 virtual_guest_firmware_entry_point;
348
349 /* guest EFI firmware image size */
350 u64 virtual_guest_firmware_image_size;
351
352 /* GPA = 1MB where EFI firmware image is copied to */
353 u64 virtual_guest_firmware_boot_base;
354 u64 virtual_guest_image_base;
355 u64 virtual_guest_image_size;
356 u64 prototype_control_channel_offset;
357 u64 virtual_guest_partition_handle;
358
359 u16 restore_action; /* Restore Action field to restore the guest
12e364b9 360 * partition */
d19642f6 361 u16 dump_action; /* For Windows guests it shows if the visordisk
12e364b9 362 * is running in dump mode */
d19642f6
BR
363 u16 nvram_fail_count;
364 u16 saved_crash_message_count; /* = CONTROLVM_CRASHMSG_MAX */
365 u32 saved_crash_message_offset; /* Offset to request payload area needed
12e364b9 366 * for crash dump */
d19642f6 367 u32 installation_error; /* Type of error encountered during
12e364b9 368 * installation */
d19642f6
BR
369 u32 installation_text_id; /* Id of string to display */
370 u16 installation_remaining_steps;/* Number of remaining installation
371 * steps (for progress bars) */
372 u8 tool_action; /* ULTRA_TOOL_ACTIONS Installation Action
12e364b9 373 * field */
d19642f6
BR
374 u8 reserved; /* alignment */
375 struct efi_spar_indication efi_spar_ind;
376 struct efi_spar_indication efi_spar_ind_supported;
377 u32 sp_reserved;
378 u8 reserved2[28]; /* Force signals to begin on 128-byte cache
12e364b9 379 * line */
d19642f6
BR
380 struct signal_queue_header request_queue;/* Service or guest partition
381 * uses this queue to send
382 * requests to Control */
383 struct signal_queue_header response_queue;/* Control uses this queue to
384 * respond to service or guest
385 * partition requests */
386 struct signal_queue_header event_queue; /* Control uses this queue to
12e364b9
KC
387 * send events to service or
388 * guest partition */
d19642f6
BR
389 struct signal_queue_header event_ack_queue;/* Service or guest partition
390 * uses this queue to ack
391 * Control events */
12e364b9
KC
392
393 /* Request fixed-size message pool - does not include payload */
d19642f6 394 struct controlvm_message request_msg[CONTROLVM_MESSAGE_MAX];
12e364b9
KC
395
396 /* Response fixed-size message pool - does not include payload */
d19642f6 397 struct controlvm_message response_msg[CONTROLVM_MESSAGE_MAX];
12e364b9
KC
398
399 /* Event fixed-size message pool - does not include payload */
d19642f6 400 struct controlvm_message event_msg[CONTROLVM_MESSAGE_MAX];
12e364b9
KC
401
402 /* Ack fixed-size message pool - does not include payload */
d19642f6 403 struct controlvm_message event_ack_msg[CONTROLVM_MESSAGE_MAX];
12e364b9
KC
404
405 /* Message stored during IOVM creation to be reused after crash */
d19642f6
BR
406 struct controlvm_message saved_crash_msg[CONTROLVM_CRASHMSG_MAX];
407};
12e364b9 408
7e5a1a76 409/* Offsets for VM channel attributes */
12e364b9 410#define VM_CH_REQ_QUEUE_OFFSET \
d19642f6 411 offsetof(struct spar_controlvm_channel_protocol, request_queue)
12e364b9 412#define VM_CH_RESP_QUEUE_OFFSET \
d19642f6 413 offsetof(struct spar_controlvm_channel_protocol, response_queue)
12e364b9 414#define VM_CH_EVENT_QUEUE_OFFSET \
d19642f6 415 offsetof(struct spar_controlvm_channel_protocol, event_queue)
12e364b9 416#define VM_CH_ACK_QUEUE_OFFSET \
d19642f6 417 offsetof(struct spar_controlvm_channel_protocol, event_ack_queue)
12e364b9 418#define VM_CH_REQ_MSG_OFFSET \
d19642f6 419 offsetof(struct spar_controlvm_channel_protocol, request_msg)
12e364b9 420#define VM_CH_RESP_MSG_OFFSET \
d19642f6 421 offsetof(struct spar_controlvm_channel_protocol, response_msg)
12e364b9 422#define VM_CH_EVENT_MSG_OFFSET \
d19642f6 423 offsetof(struct spar_controlvm_channel_protocol, event_msg)
12e364b9 424#define VM_CH_ACK_MSG_OFFSET \
d19642f6 425 offsetof(struct spar_controlvm_channel_protocol, event_ack_msg)
12e364b9 426#define VM_CH_CRASH_MSG_OFFSET \
d19642f6 427 offsetof(struct spar_controlvm_channel_protocol, saved_crash_msg)
12e364b9
KC
428
429/* The following header will be located at the beginning of PayloadVmOffset for
62420893
BR
430 * various ControlVm commands. The receiver of a ControlVm command with a
431 * PayloadVmOffset will dereference this address and then use connection_offset,
432 * initiator_offset, and target_offset to get the location of UTF-8 formatted
433 * strings that can be parsed to obtain command-specific information. The value
434 * of total_length should equal PayloadBytes. The format of the strings at
435 * PayloadVmOffset will take different forms depending on the message.
12e364b9 436 */
62420893
BR
437struct spar_controlvm_parameters_header {
438 u32 total_length;
439 u32 header_length;
440 u32 connection_offset;
441 u32 connection_length;
442 u32 initiator_offset;
443 u32 initiator_length;
444 u32 target_offset;
445 u32 target_length;
446 u32 client_offset;
447 u32 client_length;
448 u32 name_offset;
449 u32 name_length;
450 uuid_le id;
451 u32 revision;
452 u32 reserved; /* Natural alignment */
453};
12e364b9
KC
454
455#endif /* __CONTROLVMCHANNEL_H__ */