dell_rbu.c 17.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
/*
 * dell_rbu.c
 * Bios Update driver for Dell systems
 * Author: Dell Inc
 *         Abhay Salunke <abhay_salunke@dell.com>
 *
 * Copyright (C) 2005 Dell Inc.
 *
 * Remote BIOS Update (rbu) driver is used for updating DELL BIOS by
 * creating entries in the /sys file systems on Linux 2.6 and higher
 * kernels. The driver supports two mechanism to update the BIOS namely
 * contiguous and packetized. Both these methods still require having some
 * application to set the CMOS bit indicating the BIOS to update itself
 * after a reboot.
 *
 * Contiguous method:
 * This driver writes the incoming data in a monolithic image by allocating
 * contiguous physical pages large enough to accommodate the incoming BIOS
 * image size.
 *
 * Packetized method:
 * The driver writes the incoming packet image by allocating a new packet
 * on every time the packet data is written. This driver requires an
 * application to break the BIOS image in to fixed sized packet chunks.
 *
 * See Documentation/dell_rbu.txt for more info.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License v2.0 as published by
 * the Free Software Foundation
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
#include <linux/version.h>
#include <linux/config.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/blkdev.h>
44
#include <linux/platform_device.h>
45 46 47 48 49 50 51 52
#include <linux/spinlock.h>
#include <linux/moduleparam.h>
#include <linux/firmware.h>
#include <linux/dma-mapping.h>

MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>");
MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems");
MODULE_LICENSE("GPL");
53
MODULE_VERSION("3.0");
54 55 56 57 58 59 60 61 62 63 64 65 66

#define BIOS_SCAN_LIMIT 0xffffffff
#define MAX_IMAGE_LENGTH 16
static struct _rbu_data {
	void *image_update_buffer;
	unsigned long image_update_buffer_size;
	unsigned long bios_image_size;
	int image_update_ordernum;
	int dma_alloc;
	spinlock_t lock;
	unsigned long packet_read_count;
	unsigned long num_packets;
	unsigned long packetsize;
67
	unsigned long imagesize;
68
	int entry_created;
69 70
} rbu_data;

71 72
static char image_type[MAX_IMAGE_LENGTH + 1] = "mono";
module_param_string(image_type, image_type, sizeof (image_type), 0);
73 74
MODULE_PARM_DESC(image_type,
	"BIOS image type. choose- mono or packet or init");
75 76 77 78 79 80 81 82 83 84 85 86 87 88

struct packet_data {
	struct list_head list;
	size_t length;
	void *data;
	int ordernum;
};

static struct packet_data packet_data_head;

static struct platform_device *rbu_device;
static int context;
static dma_addr_t dell_rbu_dmaaddr;

A
Andrew Morton 已提交
89
static void init_packet_head(void)
90 91 92 93 94
{
	INIT_LIST_HEAD(&packet_data_head.list);
	rbu_data.packet_read_count = 0;
	rbu_data.num_packets = 0;
	rbu_data.packetsize = 0;
95
	rbu_data.imagesize = 0;
96 97
}

98
static int create_packet(void *data, size_t length)
99 100 101 102 103 104 105 106 107 108
{
	struct packet_data *newpacket;
	int ordernum = 0;

	pr_debug("create_packet: entry \n");

	if (!rbu_data.packetsize) {
		pr_debug("create_packet: packetsize not specified\n");
		return -EINVAL;
	}
109 110 111
	spin_unlock(&rbu_data.lock);
	newpacket = kmalloc(sizeof (struct packet_data), GFP_KERNEL);
	spin_lock(&rbu_data.lock);
112 113 114

	if (!newpacket) {
		printk(KERN_WARNING
115 116
			"dell_rbu:%s: failed to allocate new "
			"packet\n", __FUNCTION__);
117 118 119 120 121 122 123 124
		return -ENOMEM;
	}

	ordernum = get_order(length);
	/*
	 * there is no upper limit on memory
	 * address for packetized mechanism
	 */
125 126 127 128
	spin_unlock(&rbu_data.lock);
	newpacket->data = (unsigned char *) __get_free_pages(GFP_KERNEL,
		ordernum);
	spin_lock(&rbu_data.lock);
129 130 131 132 133

	pr_debug("create_packet: newpacket %p\n", newpacket->data);

	if (!newpacket->data) {
		printk(KERN_WARNING
134 135
			"dell_rbu:%s: failed to allocate new "
			"packet\n", __FUNCTION__);
136 137 138 139 140 141 142 143 144 145 146 147
		kfree(newpacket);
		return -ENOMEM;
	}

	newpacket->ordernum = ordernum;
	++rbu_data.num_packets;
	/*
	 * initialize the newly created packet headers
	 */
	INIT_LIST_HEAD(&newpacket->list);
	list_add_tail(&newpacket->list, &packet_data_head.list);
	/*
148
	 * packets may not have fixed size
149
	 */
150 151 152
	newpacket->length = length;

	memcpy(newpacket->data, data, length);
153 154 155 156 157 158

	pr_debug("create_packet: exit \n");

	return 0;
}

A
Andrew Morton 已提交
159
static int packetize_data(void *data, size_t length)
160 161
{
	int rc = 0;
162 163 164 165 166 167 168 169 170 171
	int done = 0;
	int packet_length;
	u8 *temp;
	u8 *end = (u8 *) data + length;
	pr_debug("packetize_data: data length %d\n", length);
	if (!rbu_data.packetsize) {
		printk(KERN_WARNING
			"dell_rbu: packetsize not specified\n");
		return -EIO;
	}
172

173 174 175 176 177 178 179 180 181 182 183 184 185
	temp = (u8 *) data;

	/* packetize the hunk */
	while (!done) {
		if ((temp + rbu_data.packetsize) < end)
			packet_length = rbu_data.packetsize;
		else {
			/* this is the last packet */
			packet_length = end - temp;
			done = 1;
		}

		if ((rc = create_packet(temp, packet_length)))
186
			return rc;
187 188 189

		pr_debug("%lu:%lu\n", temp, (end - temp));
		temp += packet_length;
190
	}
191 192

	rbu_data.imagesize = length;
193 194 195 196

	return rc;
}

A
Andrew Morton 已提交
197
static int do_packet_read(char *data, struct list_head *ptemp_list,
198
	int length, int bytes_read, int *list_read_count)
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
{
	void *ptemp_buf;
	struct packet_data *newpacket = NULL;
	int bytes_copied = 0;
	int j = 0;

	newpacket = list_entry(ptemp_list, struct packet_data, list);
	*list_read_count += newpacket->length;

	if (*list_read_count > bytes_read) {
		/* point to the start of unread data */
		j = newpacket->length - (*list_read_count - bytes_read);
		/* point to the offset in the packet buffer */
		ptemp_buf = (u8 *) newpacket->data + j;
		/*
		 * check if there is enough room in
		 * * the incoming buffer
		 */
		if (length > (*list_read_count - bytes_read))
			/*
			 * copy what ever is there in this
			 * packet and move on
			 */
			bytes_copied = (*list_read_count - bytes_read);
		else
			/* copy the remaining */
			bytes_copied = length;
		memcpy(data, ptemp_buf, bytes_copied);
	}
	return bytes_copied;
}

231
static int packet_read_list(char *data, size_t * pread_length)
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
{
	struct list_head *ptemp_list;
	int temp_count = 0;
	int bytes_copied = 0;
	int bytes_read = 0;
	int remaining_bytes = 0;
	char *pdest = data;

	/* check if we have any packets */
	if (0 == rbu_data.num_packets)
		return -ENOMEM;

	remaining_bytes = *pread_length;
	bytes_read = rbu_data.packet_read_count;

	ptemp_list = (&packet_data_head.list)->next;
	while (!list_empty(ptemp_list)) {
		bytes_copied = do_packet_read(pdest, ptemp_list,
250
			remaining_bytes, bytes_read, &temp_count);
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
		remaining_bytes -= bytes_copied;
		bytes_read += bytes_copied;
		pdest += bytes_copied;
		/*
		 * check if we reached end of buffer before reaching the
		 * last packet
		 */
		if (remaining_bytes == 0)
			break;

		ptemp_list = ptemp_list->next;
	}
	/*finally set the bytes read */
	*pread_length = bytes_read - rbu_data.packet_read_count;
	rbu_data.packet_read_count = bytes_read;
	return 0;
}

A
Andrew Morton 已提交
269
static void packet_empty_list(void)
270 271 272 273 274 275 276 277
{
	struct list_head *ptemp_list;
	struct list_head *pnext_list;
	struct packet_data *newpacket;

	ptemp_list = (&packet_data_head.list)->next;
	while (!list_empty(ptemp_list)) {
		newpacket =
278
			list_entry(ptemp_list, struct packet_data, list);
279 280 281 282 283 284 285 286
		pnext_list = ptemp_list->next;
		list_del(ptemp_list);
		ptemp_list = pnext_list;
		/*
		 * zero out the RBU packet memory before freeing
		 * to make sure there are no stale RBU packets left in memory
		 */
		memset(newpacket->data, 0, rbu_data.packetsize);
287 288
		free_pages((unsigned long) newpacket->data,
			newpacket->ordernum);
289 290 291 292
		kfree(newpacket);
	}
	rbu_data.packet_read_count = 0;
	rbu_data.num_packets = 0;
293
	rbu_data.imagesize = 0;
294 295 296 297 298 299
}

/*
 * img_update_free: Frees the buffer allocated for storing BIOS image
 * Always called with lock held and returned with lock held
 */
A
Andrew Morton 已提交
300
static void img_update_free(void)
301 302 303 304 305 306 307 308
{
	if (!rbu_data.image_update_buffer)
		return;
	/*
	 * zero out this buffer before freeing it to get rid of any stale
	 * BIOS image copied in memory.
	 */
	memset(rbu_data.image_update_buffer, 0,
309
		rbu_data.image_update_buffer_size);
310 311
	if (rbu_data.dma_alloc == 1)
		dma_free_coherent(NULL, rbu_data.bios_image_size,
312
			rbu_data.image_update_buffer, dell_rbu_dmaaddr);
313
	else
314 315
		free_pages((unsigned long) rbu_data.image_update_buffer,
			rbu_data.image_update_ordernum);
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336

	/*
	 * Re-initialize the rbu_data variables after a free
	 */
	rbu_data.image_update_ordernum = -1;
	rbu_data.image_update_buffer = NULL;
	rbu_data.image_update_buffer_size = 0;
	rbu_data.bios_image_size = 0;
	rbu_data.dma_alloc = 0;
}

/*
 * img_update_realloc: This function allocates the contiguous pages to
 * accommodate the requested size of data. The memory address and size
 * values are stored globally and on every call to this function the new
 * size is checked to see if more data is required than the existing size.
 * If true the previous memory is freed and new allocation is done to
 * accommodate the new size. If the incoming size is less then than the
 * already allocated size, then that memory is reused. This function is
 * called with lock held and returns with lock held.
 */
A
Andrew Morton 已提交
337
static int img_update_realloc(unsigned long size)
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
{
	unsigned char *image_update_buffer = NULL;
	unsigned long rc;
	unsigned long img_buf_phys_addr;
	int ordernum;
	int dma_alloc = 0;

	/*
	 * check if the buffer of sufficient size has been
	 * already allocated
	 */
	if (rbu_data.image_update_buffer_size >= size) {
		/*
		 * check for corruption
		 */
		if ((size != 0) && (rbu_data.image_update_buffer == NULL)) {
			printk(KERN_ERR "dell_rbu:%s: corruption "
355
				"check failed\n", __FUNCTION__);
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
			return -EINVAL;
		}
		/*
		 * we have a valid pre-allocated buffer with
		 * sufficient size
		 */
		return 0;
	}

	/*
	 * free any previously allocated buffer
	 */
	img_update_free();

	spin_unlock(&rbu_data.lock);

	ordernum = get_order(size);
	image_update_buffer =
374
		(unsigned char *) __get_free_pages(GFP_KERNEL, ordernum);
375 376

	img_buf_phys_addr =
377
		(unsigned long) virt_to_phys(image_update_buffer);
378 379

	if (img_buf_phys_addr > BIOS_SCAN_LIMIT) {
380
		free_pages((unsigned long) image_update_buffer, ordernum);
381 382
		ordernum = -1;
		image_update_buffer = dma_alloc_coherent(NULL, size,
383
			&dell_rbu_dmaaddr, GFP_KERNEL);
384 385 386 387 388 389 390 391 392
		dma_alloc = 1;
	}

	spin_lock(&rbu_data.lock);

	if (image_update_buffer != NULL) {
		rbu_data.image_update_buffer = image_update_buffer;
		rbu_data.image_update_buffer_size = size;
		rbu_data.bios_image_size =
393
			rbu_data.image_update_buffer_size;
394 395 396 397 398
		rbu_data.image_update_ordernum = ordernum;
		rbu_data.dma_alloc = dma_alloc;
		rc = 0;
	} else {
		pr_debug("Not enough memory for image update:"
399
			"size = %ld\n", size);
400 401 402 403 404 405
		rc = -ENOMEM;
	}

	return rc;
}

A
Andrew Morton 已提交
406
static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)
407 408 409 410 411 412 413 414 415 416 417 418 419
{
	int retval;
	size_t bytes_left;
	size_t data_length;
	char *ptempBuf = buffer;

	/* check to see if we have something to return */
	if (rbu_data.num_packets == 0) {
		pr_debug("read_packet_data: no packets written\n");
		retval = -ENOMEM;
		goto read_rbu_data_exit;
	}

420
	if (pos > rbu_data.imagesize) {
421 422
		retval = 0;
		printk(KERN_WARNING "dell_rbu:read_packet_data: "
423
			"data underrun\n");
424 425 426
		goto read_rbu_data_exit;
	}

427
	bytes_left = rbu_data.imagesize - pos;
428 429 430 431 432
	data_length = min(bytes_left, count);

	if ((retval = packet_read_list(ptempBuf, &data_length)) < 0)
		goto read_rbu_data_exit;

433
	if ((pos + count) > rbu_data.imagesize) {
434 435 436 437 438 439 440 441 442 443
		rbu_data.packet_read_count = 0;
		/* this was the last copy */
		retval = bytes_left;
	} else
		retval = count;

      read_rbu_data_exit:
	return retval;
}

A
Andrew Morton 已提交
444
static ssize_t read_rbu_mono_data(char *buffer, loff_t pos, size_t count)
445 446 447 448 449 450 451 452
{
	unsigned char *ptemp = NULL;
	size_t bytes_left = 0;
	size_t data_length = 0;
	ssize_t ret_count = 0;

	/* check to see if we have something to return */
	if ((rbu_data.image_update_buffer == NULL) ||
453
		(rbu_data.bios_image_size == 0)) {
454
		pr_debug("read_rbu_data_mono: image_update_buffer %p ,"
455 456 457
			"bios_image_size %lu\n",
			rbu_data.image_update_buffer,
			rbu_data.bios_image_size);
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
		ret_count = -ENOMEM;
		goto read_rbu_data_exit;
	}

	if (pos > rbu_data.bios_image_size) {
		ret_count = 0;
		goto read_rbu_data_exit;
	}

	bytes_left = rbu_data.bios_image_size - pos;
	data_length = min(bytes_left, count);

	ptemp = rbu_data.image_update_buffer;
	memcpy(buffer, (ptemp + pos), data_length);

	if ((pos + count) > rbu_data.bios_image_size)
		/* this was the last copy */
		ret_count = bytes_left;
	else
		ret_count = count;
      read_rbu_data_exit:
	return ret_count;
}

A
Andrew Morton 已提交
482
static ssize_t read_rbu_data(struct kobject *kobj, char *buffer,
483
	loff_t pos, size_t count)
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499
{
	ssize_t ret_count = 0;

	spin_lock(&rbu_data.lock);

	if (!strcmp(image_type, "mono"))
		ret_count = read_rbu_mono_data(buffer, pos, count);
	else if (!strcmp(image_type, "packet"))
		ret_count = read_packet_data(buffer, pos, count);
	else
		pr_debug("read_rbu_data: invalid image type specified\n");

	spin_unlock(&rbu_data.lock);
	return ret_count;
}

A
Andrew Morton 已提交
500
static void callbackfn_rbu(const struct firmware *fw, void *context)
501 502 503 504 505 506 507 508 509 510 511 512 513 514
{
	int rc = 0;

	if (!fw || !fw->size) {
		rbu_data.entry_created = 0;
		return;
	}

	spin_lock(&rbu_data.lock);
	if (!strcmp(image_type, "mono")) {
		if (!img_update_realloc(fw->size))
			memcpy(rbu_data.image_update_buffer,
				fw->data, fw->size);
	} else if (!strcmp(image_type, "packet")) {
515 516 517 518 519 520 521 522 523 524 525
		/*
		 * we need to free previous packets if a
		 * new hunk of packets needs to be downloaded
		 */
		packet_empty_list();
		if (packetize_data(fw->data, fw->size))
			/* Incase something goes wrong when we are
			 * in middle of packetizing the data, we
			 * need to free up whatever packets might
			 * have been created before we quit.
			 */
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540
			packet_empty_list();
	} else
		pr_debug("invalid image type specified.\n");
	spin_unlock(&rbu_data.lock);

	rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
		"dell_rbu", &rbu_device->dev, &context, callbackfn_rbu);
	if (rc)
		printk(KERN_ERR
			"dell_rbu:%s request_firmware_nowait failed"
			" %d\n", __FUNCTION__, rc);
	else
		rbu_data.entry_created = 1;
}

A
Andrew Morton 已提交
541
static ssize_t read_rbu_image_type(struct kobject *kobj, char *buffer,
542
	loff_t pos, size_t count)
543 544 545 546 547 548 549
{
	int size = 0;
	if (!pos)
		size = sprintf(buffer, "%s\n", image_type);
	return size;
}

A
Andrew Morton 已提交
550
static ssize_t write_rbu_image_type(struct kobject *kobj, char *buffer,
551
	loff_t pos, size_t count)
552 553
{
	int rc = count;
554 555
	int req_firm_rc = 0;
	int i;
556
	spin_lock(&rbu_data.lock);
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600
	/*
	 * Find the first newline or space
	 */
	for (i = 0; i < count; ++i)
		if (buffer[i] == '\n' || buffer[i] == ' ') {
			buffer[i] = '\0';
			break;
		}
	if (i == count)
		buffer[count] = '\0';

	if (strstr(buffer, "mono"))
		strcpy(image_type, "mono");
	else if (strstr(buffer, "packet"))
		strcpy(image_type, "packet");
	else if (strstr(buffer, "init")) {
		/*
		 * If due to the user error the driver gets in a bad
		 * state where even though it is loaded , the
		 * /sys/class/firmware/dell_rbu entries are missing.
		 * to cover this situation the user can recreate entries
		 * by writing init to image_type.
		 */
		if (!rbu_data.entry_created) {
			spin_unlock(&rbu_data.lock);
			req_firm_rc = request_firmware_nowait(THIS_MODULE,
				FW_ACTION_NOHOTPLUG, "dell_rbu",
				&rbu_device->dev, &context,
				callbackfn_rbu);
			if (req_firm_rc) {
				printk(KERN_ERR
					"dell_rbu:%s request_firmware_nowait"
					" failed %d\n", __FUNCTION__, rc);
				rc = -EIO;
			} else
				rbu_data.entry_created = 1;

			spin_lock(&rbu_data.lock);
		}
	} else {
		printk(KERN_WARNING "dell_rbu: image_type is invalid\n");
		spin_unlock(&rbu_data.lock);
		return -EINVAL;
	}
601 602 603 604 605 606

	/* we must free all previous allocations */
	packet_empty_list();
	img_update_free();
	spin_unlock(&rbu_data.lock);

607
	return rc;
608 609
}

610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635
static ssize_t read_rbu_packet_size(struct kobject *kobj, char *buffer,
	loff_t pos, size_t count)
{
	int size = 0;
	if (!pos) {
		spin_lock(&rbu_data.lock);
		size = sprintf(buffer, "%lu\n", rbu_data.packetsize);
		spin_unlock(&rbu_data.lock);
	}
	return size;
}

static ssize_t write_rbu_packet_size(struct kobject *kobj, char *buffer,
	loff_t pos, size_t count)
{
	unsigned long temp;
	spin_lock(&rbu_data.lock);
	packet_empty_list();
	sscanf(buffer, "%lu", &temp);
	if (temp < 0xffffffff)
		rbu_data.packetsize = temp;

	spin_unlock(&rbu_data.lock);
	return count;
}

636
static struct bin_attribute rbu_data_attr = {
637
	.attr = {.name = "data",.owner = THIS_MODULE,.mode = 0444},
638 639 640 641
	.read = read_rbu_data,
};

static struct bin_attribute rbu_image_type_attr = {
642
	.attr = {.name = "image_type",.owner = THIS_MODULE,.mode = 0644},
643 644 645 646
	.read = read_rbu_image_type,
	.write = write_rbu_image_type,
};

647 648 649 650 651 652
static struct bin_attribute rbu_packet_size_attr = {
	.attr = {.name = "packet_size",.owner = THIS_MODULE,.mode = 0644},
	.read = read_rbu_packet_size,
	.write = write_rbu_packet_size,
};

A
Andrew Morton 已提交
653
static int __init dcdrbu_init(void)
654 655 656 657 658 659
{
	int rc = 0;
	spin_lock_init(&rbu_data.lock);

	init_packet_head();
	rbu_device =
660
		platform_device_register_simple("dell_rbu", -1, NULL, 0);
661 662
	if (!rbu_device) {
		printk(KERN_ERR
663 664
			"dell_rbu:%s:platform_device_register_simple "
			"failed\n", __FUNCTION__);
665 666 667 668 669
		return -EIO;
	}

	sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr);
	sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr);
670 671
	sysfs_create_bin_file(&rbu_device->dev.kobj,
		&rbu_packet_size_attr);
672 673

	rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
674
		"dell_rbu", &rbu_device->dev, &context, callbackfn_rbu);
675 676
	if (rc)
		printk(KERN_ERR "dell_rbu:%s:request_firmware_nowait"
677 678 679
			" failed %d\n", __FUNCTION__, rc);
	else
		rbu_data.entry_created = 1;
680 681 682 683 684

	return rc;

}

A
Andrew Morton 已提交
685
static __exit void dcdrbu_exit(void)
686 687 688 689 690 691 692 693 694 695
{
	spin_lock(&rbu_data.lock);
	packet_empty_list();
	img_update_free();
	spin_unlock(&rbu_data.lock);
	platform_device_unregister(rbu_device);
}

module_exit(dcdrbu_exit);
module_init(dcdrbu_init);