Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: sep: do something about all the printk macros

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
46eb5a13 794f1d78

+249 -368
+11 -35
drivers/staging/sep/sep_driver_config.h
··· 199 199 200 200 /* the token that defines the start of time address */ 201 201 #define SEP_TIME_VAL_TOKEN 0x12345678 202 + 202 203 /* DEBUG LEVEL MASKS */ 203 204 #define SEP_DEBUG_LEVEL_BASIC 0x1 204 - 205 - #define SEP_DEBUG_LEVEL_REGISTERS 0x2 206 205 207 206 #define SEP_DEBUG_LEVEL_EXTENDED 0x4 208 207 209 208 210 - /* FUNCTIONAL MACROS */ 209 + /* Debug helpers */ 211 210 212 - /* debug macro without paramaters */ 213 - #define DEBUG_PRINT_0(DEBUG_LEVEL , info) \ 214 - do { \ 215 - if (DEBUG_LEVEL & sepDebug) \ 216 - printk(KERN_WARNING info); \ 217 - } while (0) 211 + #define dbg(fmt, args...) \ 212 + do {\ 213 + if (sepDebug & SEP_DEBUG_LEVEL_BASIC) \ 214 + printk(KERN_DEBUG fmt, ##args); \ 215 + } while(0); 218 216 219 - /* debug macro with 1 paramater */ 220 - #define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \ 217 + #define edbg(fmt, args...) \ 221 218 do { \ 222 - if (DEBUG_LEVEL & sepDebug) \ 223 - printk(KERN_WARNING info, param1); \ 224 - } while (0) 225 - 226 - /* debug macro with 2 paramaters */ 227 - #define DEBUG_PRINT_2(DEBUG_LEVEL, info, param1, param2) \ 228 - do { \ 229 - if (DEBUG_LEVEL & sepDebug) \ 230 - printk(KERN_WARNING info , param1, param2); \ 231 - } while (0) 232 - 233 - /* debug macro with 3 paramaters */ 234 - #define DEBUG_PRINT_3(DEBUG_LEVEL, info, param1, param2, param3) \ 235 - do { \ 236 - if (DEBUG_LEVEL & sepDebug) \ 237 - printk(KERN_WARNING info , param1, param2 , param3); \ 238 - } while (0) 239 - 240 - /* debug macro with 4 paramaters */ 241 - #define DEBUG_PRINT_4(DEBUG_LEVEL, info, param1, param2, param3, param4) \ 242 - do { \ 243 - if (DEBUG_LEVEL & sepDebug) \ 244 - printk(KERN_WARNING info, param1, param2, param3, param4); \ 245 - } while (0) 219 + if (sepDebug & SEP_DEBUG_LEVEL_EXTENDED) \ 220 + printk(KERN_DEBUG fmt, ##args); \ 221 + } while(0); 246 222 247 223 248 224
+47 -47
drivers/staging/sep/sep_ext_with_pci_driver.c
··· 167 167 -------------------------------------*/ 168 168 error = 0; 169 169 170 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 170 + edbg( 171 171 "SEP Driver:rar_virtual is %p\n", 172 172 sep_dev->rar_virtual_address); 173 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 173 + edbg( 174 174 "SEP Driver:rar_physical is %08lx\n", 175 175 sep_dev->rar_physical_address); 176 176 ··· 182 182 /* load cache */ 183 183 error = request_firmware(&fw, cache_name, &sep_dev->sep_pci_dev_ptr->dev); 184 184 if (error) { 185 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 185 + edbg( 186 186 "SEP Driver:cant request cache fw\n"); 187 187 goto end_function; 188 188 } 189 189 190 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 190 + edbg( 191 191 "SEP Driver:cache data loc is %p\n", 192 192 (void *)fw->data); 193 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 193 + edbg( 194 194 "SEP Driver:cache data size is %08Zx\n", 195 195 fw->size); 196 196 ··· 210 210 /* load resident */ 211 211 error = request_firmware(&fw, res_name, &sep_dev->sep_pci_dev_ptr->dev); 212 212 if (error) { 213 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 213 + edbg( 214 214 "SEP Driver:cant request res fw\n"); 215 215 goto end_function; 216 216 } 217 217 218 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 218 + edbg( 219 219 "SEP Driver:res data loc is %p\n", 220 220 (void *)fw->data); 221 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 221 + edbg( 222 222 "SEP Driver:res data size is %08Zx\n", 223 223 fw->size); 224 224 ··· 230 230 231 231 resident_addr = (unsigned long)sep_dev->resident_virtual_address; 232 232 233 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 233 + edbg( 234 234 "SEP Driver:resident_addr (physical )is %08lx\n", 235 235 sep_dev->resident_physical_address); 236 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 236 + edbg( 237 237 "SEP Driver:cache_addr (physical) is %08lx\n", 238 238 sep_dev->cache_physical_address); 239 239 240 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 240 + edbg( 241 241 "SEP Driver:resident_addr (logical )is %08lx\n", 242 242 resident_addr); 243 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 243 + edbg( 244 244 "SEP Driver:cache_addr (logical) is %08lx\n", 245 245 cache_addr); 246 246 247 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 247 + edbg( 248 248 "SEP Driver:resident_size is %08lx\n", sep_dev->resident_size); 249 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 249 + edbg( 250 250 "SEP Driver:cache_size is %08lx\n", sep_dev->cache_size); 251 251 252 252 ··· 277 277 // shared_virtual_address = ioremap_nocache(0xda00000,shared_area_size); 278 278 sep_dev->shared_virtual_address = kmalloc(shared_area_size, GFP_KERNEL); 279 279 if (!sep_dev->shared_virtual_address) { 280 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 280 + edbg( 281 281 "sep_driver:shared memory kmalloc failed\n"); 282 282 return -1; 283 283 } ··· 290 290 /* set the physical address of the shared area */ 291 291 *phys_shared_area_addr_ptr = sep_dev->shared_physical_address; 292 292 293 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 293 + edbg( 294 294 "SEP Driver:shared_virtual_address is %p\n", 295 295 sep_dev->shared_virtual_address); 296 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 296 + edbg( 297 297 "SEP Driver:shared_region_size is %08lx\n", 298 298 shared_area_size); 299 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 299 + edbg( 300 300 "SEP Driver:shared_physical_addr is %08lx\n", 301 301 *phys_shared_area_addr_ptr); 302 302 ··· 327 327 */ 328 328 unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address) 329 329 { 330 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 330 + edbg( 331 331 "SEP Driver:sh virt to phys v %08lx\n", 332 332 virt_address); 333 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 333 + edbg( 334 334 "SEP Driver:sh virt to phys p %08lx\n", 335 335 sep_dev->shared_physical_address 336 336 + (virt_address - (unsigned long)sep_dev->shared_virtual_address)); ··· 365 365 CODE 366 366 ---------------------------*/ 367 367 368 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 368 + edbg( 369 369 "Sep pci probe starting\n"); 370 370 error = 0; 371 371 372 372 /* enable the device */ 373 373 error = pci_enable_device(pdev); 374 374 if (error) { 375 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 375 + edbg( 376 376 "error enabling pci device\n"); 377 377 goto end_function; 378 378 } ··· 383 383 /* get the io memory start address */ 384 384 sep_dev->io_memory_start_physical_address = pci_resource_start(pdev, 0); 385 385 if (!sep_dev->io_memory_start_physical_address) { 386 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 386 + edbg( 387 387 "SEP Driver error pci resource start\n"); 388 388 goto end_function; 389 389 } ··· 391 391 /* get the io memory end address */ 392 392 sep_dev->io_memory_end_physical_address = pci_resource_end(pdev, 0); 393 393 if (!sep_dev->io_memory_end_physical_address) { 394 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 394 + edbg( 395 395 "SEP Driver error pci resource end\n"); 396 396 goto end_function; 397 397 } ··· 399 399 sep_dev->io_memory_size = sep_dev->io_memory_end_physical_address - 400 400 sep_dev->io_memory_start_physical_address + 1; 401 401 402 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 402 + edbg( 403 403 "SEP Driver:io_memory_start_physical_address is %08lx\n", 404 404 sep_dev->io_memory_start_physical_address); 405 405 406 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 406 + edbg( 407 407 "SEP Driver:io_memory_end_phyaical_address is %08lx\n", 408 408 sep_dev->io_memory_end_physical_address); 409 409 410 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 410 + edbg( 411 411 "SEP Driver:io_memory_size is %08lx\n", 412 412 sep_dev->io_memory_size); 413 413 ··· 415 415 ioremap_nocache(sep_dev->io_memory_start_physical_address, 416 416 sep_dev->io_memory_size); 417 417 if (!sep_dev->io_memory_start_virtual_address) { 418 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 418 + edbg( 419 419 "SEP Driver error ioremap of io memory\n"); 420 420 goto end_function; 421 421 } 422 422 423 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 423 + edbg( 424 424 "SEP Driver:io_memory_start_virtual_address is %p\n", 425 425 sep_dev->io_memory_start_virtual_address); 426 426 ··· 433 433 GFP_KERNEL); 434 434 435 435 if (!sep_dev->rar_virtual_address) { 436 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 436 + edbg( 437 437 "SEP Driver:cant kmalloc rar\n"); 438 438 goto end_function; 439 439 } 440 440 /* FIXME */ 441 441 sep_dev->rar_physical_address = __pa(sep_dev->rar_virtual_address); 442 442 443 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 443 + edbg( 444 444 "SEP Driver:rar_physical is %08lx\n", 445 445 sep_dev->rar_physical_address); 446 446 447 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 447 + edbg( 448 448 "SEP Driver:rar_virtual is %p\n", 449 449 sep_dev->rar_virtual_address); 450 450 451 451 452 452 #if !SEP_DRIVER_POLLING_MODE 453 453 454 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 454 + edbg( 455 455 "SEP Driver: about to write IMR and ICR REG_ADDR\n"); 456 456 457 457 /* clear ICR register */ ··· 466 466 /* FIXME: */ 467 467 error = pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, (u8 *)&sep_dev->sep_irq); 468 468 469 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 469 + edbg( 470 470 "SEP Driver: my irq is %d\n", sep_irq); 471 471 472 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 472 + edbg( 473 473 "SEP Driver: about to call request_irq\n"); 474 474 /* get the interrupt line */ 475 475 error = request_irq(sep_irq, sep_inthandler, IRQF_SHARED, ··· 478 478 goto end_function; 479 479 480 480 goto end_function; 481 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 481 + edbg( 482 482 "SEP Driver: about to write IMR REG_ADDR"); 483 483 484 484 /* set the IMR register - open only GPR 2 */ ··· 515 515 /* Loading ROM from SEP_ROM_image.h file */ 516 516 k = sizeof(CRYS_SEP_ROM); 517 517 518 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 518 + edbg( 519 519 "SEP Driver: DX_CC_TST_SepRomLoader start\n"); 520 520 521 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 521 + edbg( 522 522 "SEP Driver: k is %lu\n", k); 523 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 523 + edbg( 524 524 "SEP Driver: sep_dev->reg_base_address is %p\n", 525 525 sep_dev->reg_base_address); 526 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 526 + edbg( 527 527 "SEP Driver: CRYS_SEP_ROM_start_address_offset is %p\n", 528 528 CRYS_SEP_ROM_start_address_offset); 529 529 ··· 553 553 retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR); 554 554 } while (!regVal); 555 555 556 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 556 + edbg( 557 557 "SEP Driver: ROM polling ended\n"); 558 558 559 559 switch (regVal) { 560 560 case 0x1: 561 561 /* fatal error - read erro status from GPRO */ 562 562 Error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); 563 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 563 + edbg( 564 564 "SEP Driver: ROM polling case 1\n"); 565 565 break; 566 566 case 0x2: 567 567 /* Boot First Phase ended */ 568 568 warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); 569 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 569 + edbg( 570 570 "SEP Driver: ROM polling case 2\n"); 571 571 break; 572 572 case 0x4: 573 573 /* Cold boot ended successfully */ 574 574 warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); 575 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 575 + edbg( 576 576 "SEP Driver: ROM polling case 4\n"); 577 577 Error = 0; 578 578 break; 579 579 case 0x8: 580 580 /* Warmboot ended successfully */ 581 581 warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); 582 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 582 + edbg( 583 583 "SEP Driver: ROM polling case 8\n"); 584 584 Error = 0; 585 585 break; 586 586 case 0x10: 587 587 /* ColdWarm boot ended successfully */ 588 588 warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); 589 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 589 + edbg( 590 590 "SEP Driver: ROM polling case 16\n"); 591 591 Error = 0; 592 592 break; 593 593 case 0x20: 594 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 594 + edbg( 595 595 "SEP Driver: ROM polling case 32\n"); 596 596 break; 597 597 }
+191 -286
drivers/staging/sep/sep_main_mod.c
··· 398 398 CODE 399 399 ---------------------*/ 400 400 401 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:--------> open start\n"); 401 + dbg("SEP Driver:--------> open start\n"); 402 402 403 403 error = 0; 404 404 ··· 411 411 412 412 /* check the error */ 413 413 if (error) { 414 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 414 + edbg( 415 415 "SEP Driver: down_interruptible failed\n"); 416 416 417 417 goto end_function; ··· 422 422 423 423 end_function: 424 424 425 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- open end\n"); 425 + dbg("SEP Driver:<-------- open end\n"); 426 426 427 427 return error; 428 428 } ··· 439 439 CODE 440 440 ---------------------*/ 441 441 442 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 443 - "----------->SEP Driver: sep_release start\n"); 442 + dbg("----------->SEP Driver: sep_release start\n"); 444 443 445 444 #if 0/*!SEP_DRIVER_POLLING_MODE*/ 446 445 /* close IMR */ ··· 453 454 /* unlock the sep mutex */ 454 455 mutex_unlock(&sep_mutex); 455 456 456 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 457 - "SEP Driver:<-------- sep_release end\n"); 457 + dbg("SEP Driver:<-------- sep_release end\n"); 458 458 459 459 return 0; 460 460 } ··· 473 475 CODE 474 476 -------------------------*/ 475 477 476 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "-------->SEP Driver: mmap start\n"); 478 + dbg("-------->SEP Driver: mmap start\n"); 477 479 478 480 /* check that the size of the mapped range is as the size of the message 479 481 shared area */ 480 482 if ((vma->vm_end - vma->vm_start) > SEP_DRIVER_MMMAP_AREA_SIZE) { 481 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 483 + edbg( 482 484 "SEP Driver mmap requested size is more than allowed\n"); 483 485 printk(KERN_WARNING "SEP Driver mmap requested size is more \ 484 486 than allowed\n"); ··· 489 491 return -EAGAIN; 490 492 } 491 493 492 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 494 + edbg( 493 495 "SEP Driver:g_message_shared_area_addr is %08lx\n", 494 496 sep_dev->message_shared_area_addr); 495 497 496 498 /* get physical address */ 497 499 phys_addr = sep_dev->phys_shared_area_addr; 498 500 499 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: phys_addr is %08lx\n", 501 + edbg( "SEP Driver: phys_addr is %08lx\n", 500 502 phys_addr); 501 503 502 504 if (remap_pfn_range(vma, ··· 504 506 phys_addr >> PAGE_SHIFT, 505 507 vma->vm_end - vma->vm_start, 506 508 vma->vm_page_prot)) { 507 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 509 + edbg( 508 510 "SEP Driver remap_page_range failed\n"); 509 511 printk(KERN_WARNING "SEP Driver remap_page_range failed\n"); 510 512 return -EAGAIN; 511 513 } 512 514 513 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- mmap end\n"); 515 + dbg("SEP Driver:<-------- mmap end\n"); 514 516 515 517 return 0; 516 518 } ··· 532 534 CODE 533 535 -------------------------------------------------*/ 534 536 535 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "---------->SEP Driver poll: start\n"); 537 + dbg("---------->SEP Driver poll: start\n"); 536 538 537 539 538 540 #if SEP_DRIVER_POLLING_MODE ··· 541 543 retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR2_REG_ADDR); 542 544 543 545 for (count = 0; count < 10 * 4; count += 4) 544 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 545 - "Poll Debug Word %lu of the message is %lu\n", 546 - count, 547 - *((unsigned long *)(sep_dev->shared_area_addr + 548 - SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES + count))); 546 + edbg("Poll Debug Word %lu of the message is %lu\n", count, 547 + *((unsigned long *)(sep_dev->shared_area_addr + 548 + SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES + count))); 549 549 } 550 550 551 551 sep_dev->sep_to_host_reply_counter++; ··· 553 557 554 558 #endif 555 559 556 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 560 + edbg( 557 561 "sep_dev->host_to_sep_send_counter is %lu\n", 558 562 sep_dev->host_to_sep_send_counter); 559 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 563 + edbg( 560 564 "sep_dev->sep_to_host_reply_counter is %lu\n", 561 565 sep_dev->sep_to_host_reply_counter); 562 566 563 567 /* check if the data is ready */ 564 568 if (sep_dev->host_to_sep_send_counter == sep_dev->sep_to_host_reply_counter) { 565 569 for (count = 0; count < 12 * 4; count += 4) 566 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 567 - "Sep Mesg Word %lu of the message is %lu\n", 568 - count, *((unsigned long *)(sep_dev->shared_area_addr + count))); 570 + edbg("Sep Mesg Word %lu of the message is %lu\n", count, 571 + *((unsigned long *)(sep_dev->shared_area_addr + count))); 569 572 570 573 for (count = 0; count < 10 * 4; count += 4) 571 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 572 - "Debug Data Word %lu of the message is %lu\n", 573 - count, 574 + edbg("Debug Data Word %lu of the message is %lu\n", count, 574 575 *((unsigned long *)(sep_dev->shared_area_addr + 0x1800 + count))); 575 576 576 577 retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR2_REG_ADDR); 577 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "retVal is %lu\n", retVal); 578 + edbg( "retVal is %lu\n", retVal); 578 579 /* check if the this is sep reply or request */ 579 580 if (retVal >> 31) { 580 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 581 + edbg( 581 582 "SEP Driver: sep request in\n"); 582 583 /* request */ 583 584 mask |= POLLOUT | POLLWRNORM; 584 585 } else { 585 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: sep reply in\n"); 586 + edbg( "SEP Driver: sep reply in\n"); 586 587 mask |= POLLIN | POLLRDNORM; 587 588 } 588 589 } 589 590 590 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- poll exit\n"); 591 + dbg("SEP Driver:<-------- poll exit\n"); 591 592 return mask; 592 593 } 593 594 ··· 603 610 ------------------------*/ 604 611 error = 0; 605 612 606 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 607 - "------------>SEP Driver: ioctl start\n"); 613 + dbg("------------>SEP Driver: ioctl start\n"); 608 614 609 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: cmd is %x\n", cmd); 615 + edbg("SEP Driver: cmd is %x\n", cmd); 610 616 611 617 /* check that the command is for sep device */ 612 618 if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER) ··· 617 625 /* send command to SEP */ 618 626 sep_send_command_handler(); 619 627 620 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 628 + edbg( 621 629 "SEP Driver: after sep_send_command_handler\n"); 622 630 623 631 break; ··· 746 754 break; 747 755 } 748 756 749 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 750 - "SEP Driver:<-------- ioctl end\n"); 757 + dbg("SEP Driver:<-------- ioctl end\n"); 751 758 752 759 return error; 753 760 } ··· 766 775 767 776 ret_val = alloc_chrdev_region(&g_sep_device_number, 0, 1, "sep_sec_driver"); 768 777 if (ret_val) { 769 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 778 + edbg( 770 779 "sep_driver:major number allocation failed, retval is %d\n", ret_val); 771 780 goto end_function; 772 781 } ··· 787 796 ret_val = cdev_add(&g_sep_cdev, g_sep_device_number, 1); 788 797 789 798 if (ret_val) { 790 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 799 + edbg( 791 800 "sep_driver:cdev_add failed, retval is %d\n", 792 801 ret_val); 793 802 goto end_function_unregister_devnum; ··· 838 847 CODE 839 848 ------------------------*/ 840 849 841 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 842 - "SEP Driver:-------->Init start\n"); 843 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, 844 - "g_sep_shared_area_addr = %lx\n", 850 + dbg("SEP Driver:-------->Init start\n"); 851 + edbg("sep->shared_area_addr = %lx\n", 845 852 (unsigned long)&sep_dev->shared_area_addr); 846 853 847 854 ret_val = 0; ··· 861 872 862 873 ret_val = sep_register_driver_to_device(); 863 874 if (ret_val) { 864 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 875 + edbg( 865 876 "sep_driver:sep_driver_to_device failed, ret_val is %d\n", 866 877 ret_val); 867 878 goto end_function_unregister_from_fs; ··· 889 900 /* now set the memory regions */ 890 901 sep_dev->message_shared_area_addr = sep_dev->shared_area_addr; 891 902 892 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 903 + edbg( 893 904 "SEP Driver: g_message_shared_area_addr is %08lx\n", 894 905 sep_dev->message_shared_area_addr); 895 906 ··· 919 930 sep_dev->flow_wq_ptr = create_singlethread_workqueue("sepflowwq"); 920 931 if (sep_dev->flow_wq_ptr == 0) { 921 932 ret_val = -ENOMEM; 922 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 933 + edbg( 923 934 "sep_driver:flow queue creation failed\n"); 924 935 goto end_function_deallocate_sep_shared_area; 925 936 } 926 937 927 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 938 + edbg( 928 939 "SEP Driver: create flow workqueue \n"); 929 940 930 941 /* register driver to fs */ ··· 958 969 959 970 end_function: 960 971 961 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- Init end\n"); 972 + dbg("SEP Driver:<-------- Init end\n"); 962 973 963 974 return ret_val; 964 975 } ··· 978 989 CODE 979 990 --------------------------------*/ 980 991 981 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:--------> Exit start\n"); 992 + dbg("SEP Driver:--------> Exit start\n"); 982 993 983 994 /* unregister from fs */ 984 995 sep_unregister_driver_from_fs(); ··· 997 1008 sep_dev->shared_area_addr, 998 1009 sep_dev->phys_shared_area_addr); 999 1010 1000 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1011 + edbg( 1001 1012 "SEP Driver: free pages SEP SHARED AREA \n"); 1002 1013 1003 1014 iounmap((void *)sep_dev->reg_base_address); 1004 1015 1005 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: iounmap \n"); 1016 + edbg( "SEP Driver: iounmap \n"); 1006 1017 1007 1018 /* release io memory region */ 1008 1019 release_mem_region(SEP_IO_MEM_REGION_START_ADDRESS, SEP_IO_MEM_REGION_SIZE); 1009 1020 1010 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: release_mem_region \n"); 1021 + edbg( "SEP Driver: release_mem_region \n"); 1011 1022 1012 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- Exit end\n"); 1023 + dbg("SEP Driver:<-------- Exit end\n"); 1013 1024 } 1014 1025 1015 1026 ··· 1041 1052 1042 1053 /* read the IRR register to check if this is SEP interrupt */ 1043 1054 reg_val = sep_read_reg(sep_dev, HW_HOST_IRR_REG_ADDR); 1044 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Interrupt - reg is %08lx\n", 1055 + edbg( "SEP Interrupt - reg is %08lx\n", 1045 1056 reg_val); 1046 1057 1047 1058 /* check if this is the flow interrupt */ ··· 1128 1139 CODE 1129 1140 --------------------------*/ 1130 1141 1131 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1132 - "SEP Driver:--------> sep_prepare_input_dma_table start\n"); 1142 + dbg("SEP Driver:--------> sep_prepare_input_dma_table start\n"); 1133 1143 1134 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver:data_size is %lu\n", 1135 - data_size); 1136 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver:block_size is %lu\n", 1137 - block_size); 1144 + edbg( "SEP Driver:data_size is %lu\n", data_size); 1145 + edbg( "SEP Driver:block_size is %lu\n", block_size); 1138 1146 1139 1147 /* initialize the pages pointers */ 1140 1148 sep_dev->in_page_array = 0; ··· 1176 1190 if (result) 1177 1191 return result; 1178 1192 1179 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1193 + edbg( 1180 1194 "SEP Driver:output sep_dev->in_num_pages is %lu\n", 1181 1195 sep_dev->in_num_pages); 1182 1196 ··· 1204 1218 /* now calculate the table size so that it will be module block size */ 1205 1219 table_data_size = (table_data_size / block_size) * block_size; 1206 1220 1207 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1221 + edbg( 1208 1222 "SEP Driver:output table_data_size is %lu\n", 1209 1223 table_data_size); 1210 1224 ··· 1222 1236 *num_entries_ptr = num_entries_in_table; 1223 1237 *table_data_size_ptr = table_data_size; 1224 1238 1225 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1239 + edbg( 1226 1240 "SEP Driver:output lli_table_in_ptr is %08lx\n", 1227 1241 *lli_table_ptr); 1228 1242 } else { ··· 1248 1262 1249 1263 end_function: 1250 1264 1251 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1252 - "SEP Driver:<-------- sep_prepare_input_dma_table end\n"); 1265 + dbg("SEP Driver:<-------- sep_prepare_input_dma_table end\n"); 1253 1266 1254 1267 return 0; 1255 1268 ··· 1285 1300 CODE 1286 1301 --------------------------*/ 1287 1302 1288 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1289 - "SEP Driver:--------> sep_prepare_input_output_dma_table start\n"); 1303 + dbg("SEP Driver:--------> sep_prepare_input_output_dma_table start\n"); 1290 1304 1291 1305 result = 0; 1292 1306 ··· 1302 1318 &lli_in_array, 1303 1319 &sep_dev->in_page_array); 1304 1320 if (result) { 1305 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1321 + edbg( 1306 1322 "SEP Driver: sep_lock_kernel_pages for input virtual buffer failed\n"); 1307 1323 goto end_function; 1308 1324 } ··· 1314 1330 &lli_in_array, 1315 1331 &sep_dev->in_page_array); 1316 1332 if (result) { 1317 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1333 + edbg( 1318 1334 "SEP Driver: sep_lock_user_pages for input virtual buffer failed\n"); 1319 1335 goto end_function; 1320 1336 } ··· 1327 1343 &lli_out_array, 1328 1344 &sep_dev->out_page_array); 1329 1345 if (result) { 1330 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1346 + edbg( 1331 1347 "SEP Driver: sep_lock_kernel_pages for output virtual buffer failed\n"); 1332 1348 goto end_function_with_error1; 1333 1349 } ··· 1338 1354 &lli_out_array, 1339 1355 &sep_dev->out_page_array); 1340 1356 if (result) { 1341 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1357 + edbg( 1342 1358 "SEP Driver: sep_lock_user_pages for output virtual buffer failed\n"); 1343 1359 goto end_function_with_error1; 1344 1360 } 1345 1361 } 1346 1362 1347 1363 1348 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1364 + edbg( 1349 1365 "sep_dev->in_num_pages is %lu\n", sep_dev->in_num_pages); 1350 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1366 + edbg( 1351 1367 "sep_dev->out_num_pages is %lu\n", sep_dev->out_num_pages); 1352 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1368 + edbg( 1353 1369 "SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP is %x\n", 1354 1370 SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP); 1355 1371 ··· 1366 1382 out_num_entries_ptr, 1367 1383 table_data_size_ptr); 1368 1384 if (result) { 1369 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1385 + edbg( 1370 1386 "SEP Driver: sep_construct_dma_tables_from_lli failed\n"); 1371 1387 goto end_function_with_error2; 1372 1388 } 1373 1389 1374 1390 /* fall through - free the lli entry arrays */ 1375 1391 1376 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "in_num_entries_ptr is %08lx\n", 1392 + dbg("in_num_entries_ptr is %08lx\n", 1377 1393 *in_num_entries_ptr); 1378 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "out_num_entries_ptr is %08lx\n", 1394 + dbg("out_num_entries_ptr is %08lx\n", 1379 1395 *out_num_entries_ptr); 1380 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "table_data_size_ptr is %08lx\n", 1396 + dbg("table_data_size_ptr is %08lx\n", 1381 1397 *table_data_size_ptr); 1382 1398 1383 1399 ··· 1391 1407 1392 1408 end_function: 1393 1409 1394 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, 1395 - "SEP Driver:<-------- sep_prepare_input_output_dma_table end result = %d\n", 1396 - (int)result); 1410 + dbg("SEP Driver:<-------- sep_prepare_input_output_dma_table end result = %d\n", (int)result); 1397 1411 1398 1412 return result; 1399 1413 ··· 1456 1474 CODE 1457 1475 ------------------------*/ 1458 1476 1459 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1460 - "SEP Driver:--------> sep_construct_dma_tables_from_lli start\n"); 1477 + dbg("SEP Driver:--------> sep_construct_dma_tables_from_lli start\n"); 1461 1478 1462 1479 /* initiate to pint after the message area */ 1463 1480 lli_table_alloc_addr = sep_dev->shared_area_addr + ··· 1494 1513 &lli_out_array[current_out_entry], 1495 1514 (sep_out_lli_entries - current_out_entry)); 1496 1515 1497 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1516 + edbg( 1498 1517 "SEP Driver:in_table_data_size is %lu\n", in_table_data_size); 1499 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1518 + edbg( 1500 1519 "SEP Driver:out_table_data_size is %lu\n", out_table_data_size); 1501 1520 1502 1521 /* check where the data is smallest */ ··· 1507 1526 /* now calculate the table size so that it will be module block size */ 1508 1527 table_data_size = (table_data_size / block_size) * block_size; 1509 1528 1510 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, 1511 - "SEP Driver:table_data_size is %lu\n", 1512 - table_data_size); 1529 + dbg("SEP Driver:table_data_size is %lu\n", table_data_size); 1513 1530 1514 1531 /* construct input lli table */ 1515 1532 sep_build_lli_table(&lli_in_array[current_in_entry], ··· 1534 1555 *out_num_entries_ptr = num_entries_out_table; 1535 1556 *table_data_size_ptr = table_data_size; 1536 1557 1537 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1558 + edbg( 1538 1559 "SEP Driver:output lli_table_in_ptr is %08lx\n", *lli_table_in_ptr); 1539 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1560 + edbg( 1540 1561 "SEP Driver:output lli_table_out_ptr is %08lx\n", *lli_table_out_ptr); 1541 1562 } else { 1542 1563 /* update the info entry of the previous in table */ ··· 1556 1577 info_in_entry_ptr = in_lli_table_ptr + num_entries_in_table - 1; 1557 1578 info_out_entry_ptr = out_lli_table_ptr + num_entries_out_table - 1; 1558 1579 1559 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1580 + edbg( 1560 1581 "SEP Driver:output num_entries_out_table is %lu\n", 1561 1582 (unsigned long)num_entries_out_table); 1562 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1583 + edbg( 1563 1584 "SEP Driver:output info_in_entry_ptr is %lu\n", 1564 1585 (unsigned long)info_in_entry_ptr); 1565 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1586 + edbg( 1566 1587 "SEP Driver:output info_out_entry_ptr is %lu\n", 1567 1588 (unsigned long)info_out_entry_ptr); 1568 1589 } ··· 1581 1602 *out_num_entries_ptr, 1582 1603 *table_data_size_ptr); 1583 1604 1584 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1585 - "SEP Driver:<-------- sep_construct_dma_tables_from_lli end\n"); 1605 + dbg("SEP Driver:<-------- sep_construct_dma_tables_from_lli end\n"); 1586 1606 1587 1607 return 0; 1588 1608 } ··· 1637 1659 CODE 1638 1660 ---------------------------*/ 1639 1661 1640 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1641 - "SEP Driver:--------> sep_build_lli_table start\n"); 1662 + dbg("SEP Driver:--------> sep_build_lli_table start\n"); 1642 1663 1643 1664 /* init currrent table data size and lli array entry counter */ 1644 1665 curr_table_data_size = 0; 1645 1666 array_counter = 0; 1646 1667 *num_table_entries_ptr = 1; 1647 1668 1648 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1669 + edbg( 1649 1670 "SEP Driver:table_data_size is %lu\n", 1650 1671 table_data_size); 1651 1672 ··· 1658 1681 lli_table_ptr->block_size = lli_array_ptr[array_counter].block_size; 1659 1682 curr_table_data_size += lli_table_ptr->block_size; 1660 1683 1661 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1684 + edbg( 1662 1685 "SEP Driver:lli_table_ptr is %08lx\n", 1663 1686 (unsigned long)lli_table_ptr); 1664 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1687 + edbg( 1665 1688 "SEP Driver:lli_table_ptr->physical_address is %08lx\n", 1666 1689 lli_table_ptr->physical_address); 1667 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1690 + edbg( 1668 1691 "SEP Driver:lli_table_ptr->block_size is %lu\n", 1669 1692 lli_table_ptr->block_size); 1670 1693 1671 1694 /* check for overflow of the table data */ 1672 1695 if (curr_table_data_size > table_data_size) { 1673 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1696 + edbg( 1674 1697 "SEP Driver:curr_table_data_size > table_data_size\n"); 1675 1698 1676 1699 /* update the size of block in the table */ ··· 1687 1710 /* advance to the next entry in the lli_array */ 1688 1711 array_counter++; 1689 1712 1690 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1713 + edbg( 1691 1714 "SEP Driver:lli_table_ptr->physical_address is %08lx\n", 1692 1715 lli_table_ptr->physical_address); 1693 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1716 + edbg( 1694 1717 "SEP Driver:lli_table_ptr->block_size is %lu\n", 1695 1718 lli_table_ptr->block_size); 1696 1719 ··· 1702 1725 lli_table_ptr->physical_address = 0xffffffff; 1703 1726 lli_table_ptr->block_size = 0; 1704 1727 1705 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1728 + edbg( 1706 1729 "SEP Driver:lli_table_ptr is %08lx\n", 1707 1730 (unsigned long)lli_table_ptr); 1708 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1731 + edbg( 1709 1732 "SEP Driver:lli_table_ptr->physical_address is %08lx\n", 1710 1733 lli_table_ptr->physical_address); 1711 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1734 + edbg( 1712 1735 "SEP Driver:lli_table_ptr->block_size is %lu\n", 1713 1736 lli_table_ptr->block_size); 1714 1737 ··· 1716 1739 /* set the output parameter */ 1717 1740 *num_processed_entries_ptr += array_counter; 1718 1741 1719 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1742 + edbg( 1720 1743 "SEP Driver:*num_processed_entries_ptr is %lu\n", 1721 1744 *num_processed_entries_ptr); 1722 1745 1723 1746 1724 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1725 - "SEP Driver:<-------- sep_build_lli_table end\n"); 1747 + dbg("SEP Driver:<-------- sep_build_lli_table end\n"); 1726 1748 1727 1749 return; 1728 1750 } ··· 1741 1765 CODE 1742 1766 -------------------------------*/ 1743 1767 1744 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1745 - "SEP Driver:--------> sep_debug_print_lli_tables start\n"); 1768 + dbg("SEP Driver:--------> sep_debug_print_lli_tables start\n"); 1746 1769 1747 1770 table_count = 1; 1748 1771 while ((unsigned long)lli_table_ptr != 0xffffffff) { 1749 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 1750 - "SEP Driver: lli table %08lx, table_data_size is %lu\n", 1751 - table_count, 1752 - table_data_size); 1753 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1754 - "SEP Driver: num_table_entries is %lu\n", num_table_entries); 1772 + edbg("SEP Driver: lli table %08lx, table_data_size is %lu\n", 1773 + table_count, table_data_size); 1774 + edbg("SEP Driver: num_table_entries is %lu\n", num_table_entries); 1755 1775 1756 1776 /* print entries of the table (without info entry) */ 1757 1777 for (entries_count = 0; 1758 1778 entries_count < num_table_entries; 1759 1779 entries_count++, lli_table_ptr++) { 1760 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1761 - "SEP Driver:lli_table_ptr address is %08lx\n", 1762 - (unsigned long)lli_table_ptr); 1763 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 1764 - "SEP Driver:phys address is %08lx block size is %lu\n", 1780 + edbg("SEP Driver:lli_table_ptr address is %08lx\n", 1781 + (unsigned long)lli_table_ptr); 1782 + edbg("SEP Driver:phys address is %08lx block size is %lu\n", 1765 1783 lli_table_ptr->physical_address, lli_table_ptr->block_size); 1766 1784 } 1767 1785 1768 1786 /* point to the info entry */ 1769 1787 lli_table_ptr--; 1770 1788 1771 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1789 + edbg( 1772 1790 "SEP Driver:phys lli_table_ptr->block_size is %lu\n", 1773 1791 lli_table_ptr->block_size); 1774 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1792 + edbg( 1775 1793 "SEP Driver:phys lli_table_ptr->physical_address is %08lx\n", 1776 1794 lli_table_ptr->physical_address); 1777 1795 ··· 1775 1805 lli_table_ptr = (struct sep_lli_entry_t *) 1776 1806 (lli_table_ptr->physical_address); 1777 1807 1778 - DEBUG_PRINT_3(SEP_DEBUG_LEVEL_EXTENDED, 1779 - "SEP Driver:phys table_data_size is %lu num_table_entries is \ 1780 - %lu lli_table_ptr is%lu\n", 1781 - table_data_size, num_table_entries, (unsigned long)lli_table_ptr); 1808 + edbg("SEP Driver:phys table_data_size is %lu num_table_entries is %lu lli_table_ptr is%lu\n", 1809 + table_data_size, num_table_entries, (unsigned long)lli_table_ptr); 1782 1810 1783 1811 if ((unsigned long)lli_table_ptr != 0xffffffff) 1784 1812 lli_table_ptr = (struct sep_lli_entry_t *)sep_shared_area_phys_to_virt( ··· 1785 1817 table_count++; 1786 1818 } 1787 1819 1788 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1789 - "SEP Driver:<-------- sep_debug_print_lli_tables end\n"); 1820 + dbg("SEP Driver:<-------- sep_debug_print_lli_tables end\n"); 1790 1821 } 1791 1822 1792 1823 ··· 1829 1862 CODE 1830 1863 --------------------------*/ 1831 1864 1832 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1833 - "SEP Driver:--------> sep_lock_user_pages start\n"); 1865 + dbg("SEP Driver:--------> sep_lock_user_pages start\n"); 1834 1866 1835 1867 error = 0; 1836 1868 ··· 1838 1872 start_page = app_virt_addr >> PAGE_SHIFT; 1839 1873 num_pages = end_page - start_page + 1; 1840 1874 1841 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1875 + edbg( 1842 1876 "SEP Driver: app_virt_addr is %08lx\n", 1843 1877 app_virt_addr); 1844 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1878 + edbg( 1845 1879 "SEP Driver: data_size is %lu\n", 1846 1880 data_size); 1847 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1881 + edbg( 1848 1882 "SEP Driver: start_page is %lu\n", 1849 1883 start_page); 1850 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1884 + edbg( 1851 1885 "SEP Driver: end_page is %lu\n", 1852 1886 end_page); 1853 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 1887 + edbg( 1854 1888 "SEP Driver: num_pages is %lu\n", 1855 1889 num_pages); 1856 1890 1857 1891 /* allocate array of pages structure pointers */ 1858 1892 page_array = kmalloc(sizeof(struct page *) * num_pages, GFP_ATOMIC); 1859 1893 if (!page_array) { 1860 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1894 + edbg( 1861 1895 "SEP Driver: kmalloc for page_array failed\n"); 1862 1896 1863 1897 error = -ENOMEM; ··· 1866 1900 1867 1901 lli_array = kmalloc(sizeof(struct sep_lli_entry_t) * num_pages, GFP_ATOMIC); 1868 1902 if (!lli_array) { 1869 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 1903 + edbg( 1870 1904 "SEP Driver: kmalloc for lli_array failed\n"); 1871 1905 1872 1906 error = -ENOMEM; ··· 1882 1916 1883 1917 /* check the number of pages locked - if not all then exit with error */ 1884 1918 if (result != num_pages) { 1885 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1886 - "SEP Driver: not all pages locked by get_user_pages\n"); 1919 + dbg("SEP Driver: not all pages locked by get_user_pages\n"); 1887 1920 1888 1921 error = -ENOMEM; 1889 1922 goto end_function_with_error2; ··· 1905 1940 lli_array[0].block_size = PAGE_SIZE - (app_virt_addr & (~PAGE_MASK)); 1906 1941 1907 1942 /* debug print */ 1908 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 1909 - "lli_array[0].physical_address is %08lx, lli_array[0].block_size is %lu\n", 1943 + dbg("lli_array[0].physical_address is %08lx, lli_array[0].block_size is %lu\n", 1910 1944 lli_array[0].physical_address, 1911 1945 lli_array[0].block_size); 1912 1946 ··· 1915 1951 (unsigned long)page_to_phys(page_array[count]); 1916 1952 lli_array[count].block_size = PAGE_SIZE; 1917 1953 1918 - DEBUG_PRINT_4(SEP_DEBUG_LEVEL_EXTENDED, 1954 + edbg( 1919 1955 "lli_array[%lu].physical_address is %08lx, \ 1920 1956 lli_array[%lu].block_size is %lu\n", 1921 1957 count, lli_array[count].physical_address, ··· 1934 1970 (~PAGE_MASK); 1935 1971 1936 1972 if (lli_array[count].block_size == 0) { 1937 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, 1938 - "app_virt_addr is %08lx\n", 1939 - app_virt_addr); 1940 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "data_size is %lu\n", data_size); 1973 + dbg("app_virt_addr is %08lx\n", app_virt_addr); 1974 + dbg("data_size is %lu\n", data_size); 1941 1975 while (1); 1942 1976 } 1943 - DEBUG_PRINT_4(SEP_DEBUG_LEVEL_EXTENDED, 1977 + edbg( 1944 1978 "lli_array[%lu].physical_address is %08lx, \ 1945 1979 lli_array[%lu].block_size is %lu\n", 1946 1980 count, lli_array[count].physical_address, ··· 1969 2007 1970 2008 end_function: 1971 2009 1972 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 1973 - "SEP Driver:<-------- sep_lock_user_pages end\n"); 2010 + dbg("SEP Driver:<-------- sep_lock_user_pages end\n"); 1974 2011 1975 2012 return 0; 1976 2013 } ··· 2012 2051 CODE 2013 2052 --------------------------*/ 2014 2053 2015 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2016 - "SEP Driver:--------> sep_lock_kernel_pages start\n"); 2054 + dbg("SEP Driver:--------> sep_lock_kernel_pages start\n"); 2017 2055 2018 2056 error = 0; 2019 2057 ··· 2021 2061 start_page = kernel_virt_addr >> PAGE_SHIFT; 2022 2062 num_pages = end_page - start_page + 1; 2023 2063 2024 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2064 + edbg( 2025 2065 "SEP Driver: kernel_virt_addr is %08lx\n", 2026 2066 kernel_virt_addr); 2027 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2067 + edbg( 2028 2068 "SEP Driver: data_size is %lu\n", 2029 2069 data_size); 2030 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2070 + edbg( 2031 2071 "SEP Driver: start_page is %lx\n", 2032 2072 start_page); 2033 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2073 + edbg( 2034 2074 "SEP Driver: end_page is %lx\n", 2035 2075 end_page); 2036 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2076 + edbg( 2037 2077 "SEP Driver: num_pages is %lu\n", 2038 2078 num_pages); 2039 2079 2040 2080 lli_array = kmalloc(sizeof(struct sep_lli_entry_t) * num_pages, GFP_ATOMIC); 2041 2081 if (!lli_array) { 2042 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 2082 + edbg( 2043 2083 "SEP Driver: kmalloc for lli_array failed\n"); 2044 2084 2045 2085 error = -ENOMEM; ··· 2059 2099 PAGE_SIZE - (kernel_virt_addr & (~PAGE_MASK)); 2060 2100 2061 2101 /* debug print */ 2062 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 2063 - "lli_array[0].physical_address is %08lx, lli_array[0].block_size is %lu\n", 2102 + dbg("lli_array[0].physical_address is %08lx, lli_array[0].block_size is %lu\n", 2064 2103 lli_array[0].physical_address, 2065 2104 lli_array[0].block_size); 2066 2105 ··· 2072 2113 (unsigned long)virt_to_phys((unsigned long *)next_kernel_address); 2073 2114 lli_array[count].block_size = PAGE_SIZE; 2074 2115 2075 - DEBUG_PRINT_4(SEP_DEBUG_LEVEL_EXTENDED, 2116 + edbg( 2076 2117 "lli_array[%lu].physical_address is %08lx, \ 2077 2118 lli_array[%lu].block_size is %lu\n", 2078 2119 count, lli_array[count].physical_address, count, ··· 2092 2133 (kernel_virt_addr + data_size) & (~PAGE_MASK); 2093 2134 2094 2135 if (lli_array[count].block_size == 0) { 2095 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, 2096 - "app_virt_addr is %08lx\n", 2136 + dbg("app_virt_addr is %08lx\n", 2097 2137 kernel_virt_addr); 2098 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "data_size is %lu\n", data_size); 2138 + dbg("data_size is %lu\n", data_size); 2099 2139 while (1); 2100 2140 } 2101 2141 2102 - DEBUG_PRINT_4(SEP_DEBUG_LEVEL_EXTENDED, 2142 + edbg( 2103 2143 "lli_array[%lu].physical_address is %08lx, \ 2104 2144 lli_array[%lu].block_size is %lu\n", 2105 2145 count, lli_array[count].physical_address, ··· 2114 2156 2115 2157 end_function: 2116 2158 2117 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2118 - "SEP Driver:<-------- sep_lock_kernel_pages end\n"); 2159 + dbg("SEP Driver:<-------- sep_lock_kernel_pages end\n"); 2119 2160 2120 2161 return 0; 2121 2162 } ··· 2164 2207 2165 2208 unsigned long count; 2166 2209 2167 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2168 - "SEP Driver:--------> sep_send_command_handler start\n"); 2210 + dbg("SEP Driver:--------> sep_send_command_handler start\n"); 2169 2211 2170 2212 sep_set_time(0, 0); 2171 2213 ··· 2172 2216 flush_cache_all(); 2173 2217 2174 2218 for (count = 0; count < 12 * 4; count += 4) 2175 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 2176 - "Word %lu of the message is %lu\n", 2177 - count, 2178 - *((unsigned long *)(sep_dev->shared_area_addr + count))); 2219 + edbg("Word %lu of the message is %lu\n", count, 2220 + *((unsigned long *)(sep_dev->shared_area_addr + count))); 2179 2221 2180 2222 /* update counter */ 2181 2223 sep_dev->host_to_sep_send_counter++; ··· 2181 2227 /* send interrupt to SEP */ 2182 2228 sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2); 2183 2229 2184 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2185 - "SEP Driver:<-------- sep_send_command_handler end\n"); 2230 + dbg("SEP Driver:<-------- sep_send_command_handler end\n"); 2186 2231 2187 2232 return; 2188 2233 } ··· 2194 2241 { 2195 2242 unsigned long count; 2196 2243 2197 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2198 - "SEP Driver:--------> sep_send_reply_command_handler start\n"); 2244 + dbg("SEP Driver:--------> sep_send_reply_command_handler start\n"); 2199 2245 2200 2246 /* flash cache */ 2201 2247 flush_cache_all(); 2202 2248 2203 2249 for (count = 0; count < 12 * 4; count += 4) 2204 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 2205 - "Word %lu of the message is %lu\n", 2206 - count, 2207 - *((unsigned long *)(sep_dev->shared_area_addr + count))); 2250 + edbg("Word %lu of the message is %lu\n", count, 2251 + *((unsigned long *)(sep_dev->shared_area_addr + count))); 2208 2252 2209 2253 2210 2254 /* update counter */ ··· 2216 2266 2217 2267 sep_dev->sep_to_host_reply_counter++; 2218 2268 2219 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2220 - "SEP Driver:<-------- sep_send_reply_command_handler end\n"); 2269 + dbg("SEP Driver:<-------- sep_send_reply_command_handler end\n"); 2221 2270 2222 2271 return; 2223 2272 } ··· 2242 2293 CODE 2243 2294 ----------------------------*/ 2244 2295 2245 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2246 - "SEP Driver:--------> sep_allocate_data_pool_memory_handler start\n"); 2296 + dbg("SEP Driver:--------> sep_allocate_data_pool_memory_handler start\n"); 2247 2297 2248 2298 2249 2299 error = copy_from_user(&command_args, ··· 2278 2330 2279 2331 end_function: 2280 2332 2281 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2282 - "SEP Driver:<-------- sep_allocate_data_pool_memory_handler end\n"); 2333 + dbg("SEP Driver:<-------- sep_allocate_data_pool_memory_handler end\n"); 2283 2334 2284 2335 return error; 2285 2336 } ··· 2307 2360 CODE 2308 2361 -----------------------------*/ 2309 2362 2310 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2311 - "SEP Driver:--------> sep_write_into_data_pool_handler start\n"); 2363 + dbg("SEP Driver:--------> sep_write_into_data_pool_handler start\n"); 2312 2364 2313 2365 /* get the application address */ 2314 2366 error = get_user(app_in_address, ··· 2346 2400 2347 2401 end_function: 2348 2402 2349 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2350 - "SEP Driver:<-------- sep_write_into_data_pool_handler end\n"); 2403 + dbg("SEP Driver:<-------- sep_write_into_data_pool_handler end\n"); 2351 2404 2352 2405 return error; 2353 2406 } ··· 2375 2430 CODE 2376 2431 -----------------------------*/ 2377 2432 2378 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2379 - "SEP Driver:--------> sep_read_from_data_pool_handler start\n"); 2433 + dbg("SEP Driver:--------> sep_read_from_data_pool_handler start\n"); 2380 2434 2381 2435 /* get the application address */ 2382 2436 error = get_user(app_out_address, ··· 2412 2468 2413 2469 end_function: 2414 2470 2415 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2416 - "SEP Driver:<-------- sep_read_from_data_pool_handler end\n"); 2471 + dbg("SEP Driver:<-------- sep_read_from_data_pool_handler end\n"); 2417 2472 2418 2473 return error; 2419 2474 } ··· 2434 2491 CODE 2435 2492 --------------------------*/ 2436 2493 2437 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2438 - "SEP Driver:--------> sep_create_sync_dma_tables_handler start\n"); 2494 + dbg("SEP Driver:--------> sep_create_sync_dma_tables_handler start\n"); 2439 2495 2440 2496 error = copy_from_user(&command_args, 2441 2497 (void *)arg, ··· 2442 2500 if (error) 2443 2501 goto end_function; 2444 2502 2445 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2503 + edbg( 2446 2504 "app_in_address is %08lx\n", 2447 2505 command_args.app_in_address); 2448 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2506 + edbg( 2449 2507 "app_out_address is %08lx\n", 2450 2508 command_args.app_out_address); 2451 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2509 + edbg( 2452 2510 "data_size is %lu\n", 2453 2511 command_args.data_in_size); 2454 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 2512 + edbg( 2455 2513 "block_size is %lu\n", 2456 2514 command_args.block_size); 2457 2515 ··· 2489 2547 2490 2548 end_function: 2491 2549 2492 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2493 - "SEP Driver:<-------- sep_create_sync_dma_tables_handler end\n"); 2550 + dbg("SEP Driver:<-------- sep_create_sync_dma_tables_handler end\n"); 2494 2551 2495 2552 return error; 2496 2553 } ··· 2503 2562 CODE 2504 2563 -----------------------------*/ 2505 2564 2506 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2507 - "SEP Driver:--------> sep_free_dma_table_data_handler start\n"); 2565 + dbg("SEP Driver:--------> sep_free_dma_table_data_handler start\n"); 2508 2566 2509 2567 /* free input pages array */ 2510 2568 sep_free_dma_pages(sep_dev->in_page_array, ··· 2523 2583 sep_dev->out_num_pages = 0; 2524 2584 2525 2585 2526 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2527 - "SEP Driver:<-------- sep_free_dma_table_data_handler end\n"); 2586 + dbg("SEP Driver:<-------- sep_free_dma_table_data_handler end\n"); 2528 2587 2529 2588 return 0; 2530 2589 } ··· 2555 2616 CODE 2556 2617 --------------------------*/ 2557 2618 2558 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2559 - "SEP Driver:--------> sep_create_flow_dma_tables_handler start\n"); 2619 + dbg("SEP Driver:--------> sep_create_flow_dma_tables_handler start\n"); 2560 2620 2561 2621 /* init variables */ 2562 2622 prev_info_entry_ptr = 0; ··· 2620 2682 2621 2683 end_function: 2622 2684 2623 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2624 - "SEP Driver:<-------- sep_create_flow_dma_tables_handler end\n"); 2685 + dbg("SEP Driver:<-------- sep_create_flow_dma_tables_handler end\n"); 2625 2686 2626 2687 return error; 2627 2688 ··· 2656 2719 CODE 2657 2720 ----------------------------*/ 2658 2721 2659 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2660 - "SEP Driver:--------> sep_add_flow_tables_handler start\n"); 2722 + dbg("SEP Driver:--------> sep_add_flow_tables_handler start\n"); 2661 2723 2662 2724 /* get input parameters */ 2663 2725 error = copy_from_user(&command_args, ··· 2758 2822 2759 2823 end_function: 2760 2824 2761 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2762 - "SEP Driver:<-------- sep_add_flow_tables_handler end\n"); 2825 + dbg("SEP Driver:<-------- sep_add_flow_tables_handler end\n"); 2763 2826 2764 2827 return error; 2765 2828 } ··· 2781 2846 CODE 2782 2847 ------------------------------*/ 2783 2848 2784 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2785 - "SEP Driver:--------> sep_add_flow_tables_message_handler start\n"); 2849 + dbg("SEP Driver:--------> sep_add_flow_tables_message_handler start\n"); 2786 2850 2787 2851 error = copy_from_user(&command_args, 2788 2852 (void *)arg, ··· 2811 2877 2812 2878 end_function: 2813 2879 2814 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2815 - "SEP Driver:<-------- sep_add_flow_tables_message_handler end\n"); 2880 + dbg("SEP Driver:<-------- sep_add_flow_tables_message_handler end\n"); 2816 2881 2817 2882 return error; 2818 2883 } ··· 2832 2899 CODE 2833 2900 ------------------------------*/ 2834 2901 2835 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2836 - "SEP Driver:--------> sep_get_static_pool_addr_handler start\n"); 2902 + dbg("SEP Driver:--------> sep_get_static_pool_addr_handler start\n"); 2837 2903 2838 2904 /*prepare the output parameters in the struct */ 2839 2905 command_args.physical_static_address = sep_dev->phys_shared_area_addr + ··· 2840 2908 command_args.virtual_static_address = sep_dev->shared_area_addr + 2841 2909 SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; 2842 2910 2843 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 2844 - "SEP Driver:physical_static_address is %08lx, virtual_static_address %08lx\n", 2911 + edbg("SEP Driver:physical_static_address is %08lx, virtual_static_address %08lx\n", 2845 2912 command_args.physical_static_address, 2846 2913 command_args.virtual_static_address); 2847 2914 ··· 2853 2922 2854 2923 end_function: 2855 2924 2856 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2857 - "SEP Driver:<-------- sep_get_static_pool_addr_handler end\n"); 2925 + dbg("SEP Driver:<-------- sep_get_static_pool_addr_handler end\n"); 2858 2926 2859 2927 return error; 2860 2928 } ··· 2874 2944 CODE 2875 2945 ------------------------------*/ 2876 2946 2877 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2878 - "SEP Driver:--------> sep_get_physical_mapped_offset_handler start\n"); 2947 + dbg("SEP Driver:--------> sep_get_physical_mapped_offset_handler start\n"); 2879 2948 2880 2949 error = copy_from_user(&command_args, 2881 2950 (void *)arg, ··· 2891 2962 command_args.offset = command_args.physical_address - 2892 2963 sep_dev->phys_shared_area_addr; 2893 2964 2894 - DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, 2895 - "SEP Driver:physical_address is %08lx, offset is %lu\n", 2965 + edbg("SEP Driver:physical_address is %08lx, offset is %lu\n", 2896 2966 command_args.physical_address, 2897 2967 command_args.offset); 2898 2968 ··· 2904 2976 2905 2977 end_function: 2906 2978 2907 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2908 - "SEP Driver:<-------- sep_get_physical_mapped_offset_handler end\n"); 2979 + dbg("SEP Driver:<-------- sep_get_physical_mapped_offset_handler end\n"); 2909 2980 2910 2981 return error; 2911 2982 } ··· 2925 2998 CODE 2926 2999 ------------------------------*/ 2927 3000 2928 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2929 - "SEP Driver:--------> sep_start_handler start\n"); 3001 + dbg("SEP Driver:--------> sep_start_handler start\n"); 2930 3002 2931 3003 error = 0; 2932 3004 ··· 2943 3017 2944 3018 end_function: 2945 3019 2946 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2947 - "SEP Driver:<-------- sep_start_handler end\n"); 3020 + dbg("SEP Driver:<-------- sep_start_handler end\n"); 2948 3021 2949 3022 return error; 2950 3023 } ··· 2975 3050 CODE 2976 3051 ---------------------*/ 2977 3052 2978 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2979 - "SEP Driver:--------> sep_init_handler start\n"); 3053 + dbg("SEP Driver:--------> sep_init_handler start\n"); 2980 3054 2981 3055 error = 0; 2982 3056 2983 3057 error = copy_from_user(&command_args, (void *)arg, 2984 3058 sizeof(struct sep_driver_init_t)); 2985 3059 2986 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2987 - "SEP Driver:--------> sep_init_handler - finished copy_from_user \n"); 3060 + dbg("SEP Driver:--------> sep_init_handler - finished copy_from_user \n"); 2988 3061 2989 3062 if (error) 2990 3063 goto end_function; ··· 2990 3067 /* PATCH - configure the DMA to single -burst instead of multi-burst */ 2991 3068 /*sep_configure_dma_burst();*/ 2992 3069 2993 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 2994 - "SEP Driver:--------> sep_init_handler - finished sep_configure_dma_burst \n"); 3070 + dbg("SEP Driver:--------> sep_init_handler - finished sep_configure_dma_burst \n"); 2995 3071 2996 3072 message_ptr = (unsigned long *)command_args.message_addr; 2997 3073 ··· 3006 3084 sep_write_reg(sep_dev, HW_SRAM_DATA_REG_ADDR, 3007 3085 message_word); 3008 3086 3009 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3087 + edbg( 3010 3088 "SEP Driver:message_word is %lu\n", 3011 3089 message_word); 3012 3090 ··· 3014 3092 sep_wait_sram_write(sep_dev); 3015 3093 } 3016 3094 3017 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3018 - "SEP Driver:--------> sep_init_handler - finished getting messages from user space\n"); 3095 + dbg("SEP Driver:--------> sep_init_handler - finished getting messages from user space\n"); 3019 3096 3020 3097 /* signal SEP */ 3021 3098 sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, ··· 3024 3103 reg_val = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR); 3025 3104 } while (!(reg_val & 0xFFFFFFFD)); 3026 3105 3027 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3028 - "SEP Driver:--------> sep_init_handler - finished waiting for reg_val & 0xFFFFFFFD \n"); 3106 + dbg("SEP Driver:--------> sep_init_handler - finished waiting for reg_val & 0xFFFFFFFD \n"); 3029 3107 3030 3108 /* check the value */ 3031 3109 if (reg_val == 0x1) { 3032 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, 3110 + edbg( 3033 3111 "SEP Driver:init failed\n"); 3034 3112 3035 3113 error = sep_read_reg(sep_dev, 0x8060); 3036 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3114 + edbg( 3037 3115 "SEP Driver:sw monitor is %lu\n", 3038 3116 error); 3039 3117 3040 3118 /* fatal error - read erro status from GPRO */ 3041 3119 error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); 3042 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3120 + edbg( 3043 3121 "SEP Driver:error is %lu\n", error); 3044 3122 goto end_function; 3045 3123 } 3046 3124 3047 3125 end_function: 3048 3126 3049 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3050 - "SEP Driver:<-------- sep_init_handler end\n"); 3127 + dbg("SEP Driver:<-------- sep_init_handler end\n"); 3051 3128 3052 3129 return error; 3053 3130 ··· 3109 3190 /* set the new shared area */ 3110 3191 command_args.new_shared_area_addr = sep_dev->phys_shared_area_addr; 3111 3192 3112 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3193 + edbg( 3113 3194 "SEP Driver:command_args.new_shared_area_addr is %08lx\n", 3114 3195 command_args.new_shared_area_addr); 3115 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3196 + edbg( 3116 3197 "SEP Driver:command_args.new_base_addr is %08lx\n", 3117 3198 command_args.new_base_addr); 3118 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3199 + edbg( 3119 3200 "SEP Driver:command_args.new_resident_addr is %08lx\n", 3120 3201 command_args.new_resident_addr); 3121 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3202 + edbg( 3122 3203 "SEP Driver:command_args.new_cache_addr is %08lx\n", 3123 3204 command_args.new_cache_addr); 3124 3205 ··· 3174 3255 CODE 3175 3256 -----------------------------*/ 3176 3257 3177 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3178 - "SEP Driver:--------> sep_set_api_mode_handler start\n"); 3258 + dbg("SEP Driver:--------> sep_set_api_mode_handler start\n"); 3179 3259 3180 3260 error = get_user( 3181 3261 mode_flag, &(((struct sep_driver_set_api_mode_t *)arg)->mode)); ··· 3187 3269 3188 3270 end_function: 3189 3271 3190 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3191 - "SEP Driver:<-------- sep_set_api_mode_handler end\n"); 3272 + dbg("SEP Driver:<-------- sep_set_api_mode_handler end\n"); 3192 3273 3193 3274 return error; 3194 3275 } ··· 3201 3284 CODE 3202 3285 -----------------------------*/ 3203 3286 3204 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3205 - "SEP Driver:--------> sep_end_transaction_handler start\n"); 3287 + dbg("SEP Driver:--------> sep_end_transaction_handler start\n"); 3206 3288 3207 3289 #if 0/*!SEP_DRIVER_POLLING_MODE*/ 3208 3290 /* close IMR */ ··· 3214 3298 mutex_unlock(&sep_mutex); 3215 3299 #endif 3216 3300 3217 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3218 - "SEP Driver:<-------- sep_end_transaction_handler end\n"); 3301 + dbg("SEP Driver:<-------- sep_end_transaction_handler end\n"); 3219 3302 3220 3303 return 0; 3221 3304 } ··· 3638 3723 CODE 3639 3724 -----------------------*/ 3640 3725 3641 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3642 - "------------>SEP Driver: sep_set_flow_id_handler start\n"); 3726 + dbg("------------>SEP Driver: sep_set_flow_id_handler start\n"); 3643 3727 3644 3728 error = get_user(flow_id, 3645 3729 &(((struct sep_driver_set_flow_id_t *)arg)->flow_id)); ··· 3656 3742 3657 3743 end_function: 3658 3744 3659 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3660 - "SEP Driver:<-------- sep_set_flow_id_handler end\n"); 3745 + dbg("SEP Driver:<-------- sep_set_flow_id_handler end\n"); 3661 3746 3662 3747 3663 3748 return error; ··· 3680 3767 CODE 3681 3768 --------------------------*/ 3682 3769 3683 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3684 - "SEP Driver:--------> sep_set_time start\n"); 3770 + dbg("SEP Driver:--------> sep_set_time start\n"); 3685 3771 3686 3772 3687 3773 do_gettimeofday(&time); ··· 3692 3780 *(unsigned long *)time_addr = SEP_TIME_VAL_TOKEN; 3693 3781 *(unsigned long *)(time_addr + 4) = time.tv_sec; 3694 3782 3695 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3783 + edbg( 3696 3784 "SEP Driver:time.tv_sec is %lu\n", 3697 3785 time.tv_sec); 3698 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3786 + edbg( 3699 3787 "SEP Driver:time_addr is %lu\n", 3700 3788 time_addr); 3701 - DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, 3789 + edbg( 3702 3790 "SEP Driver:g_message_shared_area_addr is %lu\n", 3703 3791 sep_dev->message_shared_area_addr); 3704 3792 ··· 3709 3797 if (time_in_sec_ptr) 3710 3798 *time_in_sec_ptr = time.tv_sec; 3711 3799 3712 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3713 - "SEP Driver:<-------- sep_set_time end\n"); 3800 + dbg("SEP Driver:<-------- sep_set_time end\n"); 3714 3801 3715 3802 return 0; 3716 3803 } ··· 3731 3820 3732 3821 #define HW_AHB_RD_WR_BURSTS_REG_ADDR 0x0E10UL 3733 3822 3734 - unsigned long regVal; 3735 - 3736 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3737 - "SEP Driver:<-------- sep_configure_dma_burst start \n"); 3823 + dbg("SEP Driver:<-------- sep_configure_dma_burst start \n"); 3738 3824 3739 3825 /* request access to registers from SEP */ 3740 3826 sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2); 3741 3827 3742 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3743 - "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg) \n"); 3828 + dbg("SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg) \n"); 3744 3829 3745 3830 sep_wait_busy(sep_dev); 3746 3831 3747 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3748 - "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop) \n"); 3832 + dbg("SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop) \n"); 3749 3833 3750 3834 /* set the DMA burst register to single burst*/ 3751 3835 sep_write_reg(sep_dev, HW_AHB_RD_WR_BURSTS_REG_ADDR, 0x0UL); ··· 3749 3843 sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x0UL); 3750 3844 sep_wait_busy(sep_dev); 3751 3845 3752 - DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3753 - "SEP Driver:<-------- sep_configure_dma_burst done \n"); 3846 + dbg("SEP Driver:<-------- sep_configure_dma_burst done \n"); 3754 3847 3755 3848 } 3756 3849