@@ -307,7 +307,6 @@ static const struct dmi_system_id dell_quirks[] __initconst = {
307307};
308308
309309static struct calling_interface_buffer * buffer ;
310- static struct page * bufferpage ;
311310static DEFINE_MUTEX (buffer_mutex );
312311
313312static int hwswitch_state ;
@@ -424,45 +423,125 @@ static inline int dell_smi_error(int value)
424423 }
425424}
426425
427- /* Derived from information in DellWirelessCtl.cpp:
428- Class 17, select 11 is radio control. It returns an array of 32-bit values.
429-
430- Input byte 0 = 0: Wireless information
431-
432- result[0]: return code
433- result[1]:
434- Bit 0: Hardware switch supported
435- Bit 1: Wifi locator supported
436- Bit 2: Wifi is supported
437- Bit 3: Bluetooth is supported
438- Bit 4: WWAN is supported
439- Bit 5: Wireless keyboard supported
440- Bits 6-7: Reserved
441- Bit 8: Wifi is installed
442- Bit 9: Bluetooth is installed
443- Bit 10: WWAN is installed
444- Bits 11-15: Reserved
445- Bit 16: Hardware switch is on
446- Bit 17: Wifi is blocked
447- Bit 18: Bluetooth is blocked
448- Bit 19: WWAN is blocked
449- Bits 20-31: Reserved
450- result[2]: NVRAM size in bytes
451- result[3]: NVRAM format version number
452-
453- Input byte 0 = 2: Wireless switch configuration
454- result[0]: return code
455- result[1]:
456- Bit 0: Wifi controlled by switch
457- Bit 1: Bluetooth controlled by switch
458- Bit 2: WWAN controlled by switch
459- Bits 3-6: Reserved
460- Bit 7: Wireless switch config locked
461- Bit 8: Wifi locator enabled
462- Bits 9-14: Reserved
463- Bit 15: Wifi locator setting locked
464- Bits 16-31: Reserved
465- */
426+ /*
427+ * Derived from information in smbios-wireless-ctl:
428+ *
429+ * cbSelect 17, Value 11
430+ *
431+ * Return Wireless Info
432+ * cbArg1, byte0 = 0x00
433+ *
434+ * cbRes1 Standard return codes (0, -1, -2)
435+ * cbRes2 Info bit flags:
436+ *
437+ * 0 Hardware switch supported (1)
438+ * 1 WiFi locator supported (1)
439+ * 2 WLAN supported (1)
440+ * 3 Bluetooth (BT) supported (1)
441+ * 4 WWAN supported (1)
442+ * 5 Wireless KBD supported (1)
443+ * 6 Uw b supported (1)
444+ * 7 WiGig supported (1)
445+ * 8 WLAN installed (1)
446+ * 9 BT installed (1)
447+ * 10 WWAN installed (1)
448+ * 11 Uw b installed (1)
449+ * 12 WiGig installed (1)
450+ * 13-15 Reserved (0)
451+ * 16 Hardware (HW) switch is On (1)
452+ * 17 WLAN disabled (1)
453+ * 18 BT disabled (1)
454+ * 19 WWAN disabled (1)
455+ * 20 Uw b disabled (1)
456+ * 21 WiGig disabled (1)
457+ * 20-31 Reserved (0)
458+ *
459+ * cbRes3 NVRAM size in bytes
460+ * cbRes4, byte 0 NVRAM format version number
461+ *
462+ *
463+ * Set QuickSet Radio Disable Flag
464+ * cbArg1, byte0 = 0x01
465+ * cbArg1, byte1
466+ * Radio ID value:
467+ * 0 Radio Status
468+ * 1 WLAN ID
469+ * 2 BT ID
470+ * 3 WWAN ID
471+ * 4 UWB ID
472+ * 5 WIGIG ID
473+ * cbArg1, byte2 Flag bits:
474+ * 0 QuickSet disables radio (1)
475+ * 1-7 Reserved (0)
476+ *
477+ * cbRes1 Standard return codes (0, -1, -2)
478+ * cbRes2 QuickSet (QS) radio disable bit map:
479+ * 0 QS disables WLAN
480+ * 1 QS disables BT
481+ * 2 QS disables WWAN
482+ * 3 QS disables UWB
483+ * 4 QS disables WIGIG
484+ * 5-31 Reserved (0)
485+ *
486+ * Wireless Switch Configuration
487+ * cbArg1, byte0 = 0x02
488+ *
489+ * cbArg1, byte1
490+ * Subcommand:
491+ * 0 Get config
492+ * 1 Set config
493+ * 2 Set WiFi locator enable/disable
494+ * cbArg1,byte2
495+ * Switch settings (if byte 1==1):
496+ * 0 WLAN sw itch control (1)
497+ * 1 BT sw itch control (1)
498+ * 2 WWAN sw itch control (1)
499+ * 3 UWB sw itch control (1)
500+ * 4 WiGig sw itch control (1)
501+ * 5-7 Reserved (0)
502+ * cbArg1, byte2 Enable bits (if byte 1==2):
503+ * 0 Enable WiFi locator (1)
504+ *
505+ * cbRes1 Standard return codes (0, -1, -2)
506+ * cbRes2 QuickSet radio disable bit map:
507+ * 0 WLAN controlled by sw itch (1)
508+ * 1 BT controlled by sw itch (1)
509+ * 2 WWAN controlled by sw itch (1)
510+ * 3 UWB controlled by sw itch (1)
511+ * 4 WiGig controlled by sw itch (1)
512+ * 5-6 Reserved (0)
513+ * 7 Wireless sw itch config locked (1)
514+ * 8 WiFi locator enabled (1)
515+ * 9-14 Reserved (0)
516+ * 15 WiFi locator setting locked (1)
517+ * 16-31 Reserved (0)
518+ *
519+ * Read Local Config Data (LCD)
520+ * cbArg1, byte0 = 0x10
521+ * cbArg1, byte1 NVRAM index low byte
522+ * cbArg1, byte2 NVRAM index high byte
523+ * cbRes1 Standard return codes (0, -1, -2)
524+ * cbRes2 4 bytes read from LCD[index]
525+ * cbRes3 4 bytes read from LCD[index+4]
526+ * cbRes4 4 bytes read from LCD[index+8]
527+ *
528+ * Write Local Config Data (LCD)
529+ * cbArg1, byte0 = 0x11
530+ * cbArg1, byte1 NVRAM index low byte
531+ * cbArg1, byte2 NVRAM index high byte
532+ * cbArg2 4 bytes to w rite at LCD[index]
533+ * cbArg3 4 bytes to w rite at LCD[index+4]
534+ * cbArg4 4 bytes to w rite at LCD[index+8]
535+ * cbRes1 Standard return codes (0, -1, -2)
536+ *
537+ * Populate Local Config Data from NVRAM
538+ * cbArg1, byte0 = 0x12
539+ * cbRes1 Standard return codes (0, -1, -2)
540+ *
541+ * Commit Local Config Data to NVRAM
542+ * cbArg1, byte0 = 0x13
543+ * cbRes1 Standard return codes (0, -1, -2)
544+ */
466545
467546static int dell_rfkill_set (void * data , bool blocked )
468547{
@@ -550,12 +629,21 @@ static int dell_debugfs_show(struct seq_file *s, void *data)
550629 (status & BIT (4 )) >> 4 );
551630 seq_printf (s , "Bit 5 : Wireless keyboard supported: %lu\n" ,
552631 (status & BIT (5 )) >> 5 );
632+ seq_printf (s , "Bit 6 : UWB supported: %lu\n" ,
633+ (status & BIT (6 )) >> 6 );
634+ seq_printf (s , "Bit 7 : WiGig supported: %lu\n" ,
635+ (status & BIT (7 )) >> 7 );
553636 seq_printf (s , "Bit 8 : Wifi is installed: %lu\n" ,
554637 (status & BIT (8 )) >> 8 );
555638 seq_printf (s , "Bit 9 : Bluetooth is installed: %lu\n" ,
556639 (status & BIT (9 )) >> 9 );
557640 seq_printf (s , "Bit 10: WWAN is installed: %lu\n" ,
558641 (status & BIT (10 )) >> 10 );
642+ seq_printf (s , "Bit 11: UWB installed: %lu\n" ,
643+ (status & BIT (11 )) >> 11 );
644+ seq_printf (s , "Bit 12: WiGig installed: %lu\n" ,
645+ (status & BIT (12 )) >> 12 );
646+
559647 seq_printf (s , "Bit 16: Hardware switch is on: %lu\n" ,
560648 (status & BIT (16 )) >> 16 );
561649 seq_printf (s , "Bit 17: Wifi is blocked: %lu\n" ,
@@ -564,6 +652,10 @@ static int dell_debugfs_show(struct seq_file *s, void *data)
564652 (status & BIT (18 )) >> 18 );
565653 seq_printf (s , "Bit 19: WWAN is blocked: %lu\n" ,
566654 (status & BIT (19 )) >> 19 );
655+ seq_printf (s , "Bit 20: UWB is blocked: %lu\n" ,
656+ (status & BIT (20 )) >> 20 );
657+ seq_printf (s , "Bit 21: WiGig is blocked: %lu\n" ,
658+ (status & BIT (21 )) >> 21 );
567659
568660 seq_printf (s , "\nhwswitch_state:\t0x%X\n" , hwswitch_state );
569661 seq_printf (s , "Bit 0 : Wifi controlled by switch: %lu\n" ,
@@ -572,6 +664,10 @@ static int dell_debugfs_show(struct seq_file *s, void *data)
572664 (hwswitch_state & BIT (1 )) >> 1 );
573665 seq_printf (s , "Bit 2 : WWAN controlled by switch: %lu\n" ,
574666 (hwswitch_state & BIT (2 )) >> 2 );
667+ seq_printf (s , "Bit 3 : UWB controlled by switch: %lu\n" ,
668+ (hwswitch_state & BIT (3 )) >> 3 );
669+ seq_printf (s , "Bit 4 : WiGig controlled by switch: %lu\n" ,
670+ (hwswitch_state & BIT (4 )) >> 4 );
575671 seq_printf (s , "Bit 7 : Wireless switch config locked: %lu\n" ,
576672 (hwswitch_state & BIT (7 )) >> 7 );
577673 seq_printf (s , "Bit 8 : Wifi locator enabled: %lu\n" ,
@@ -1972,12 +2068,11 @@ static int __init dell_init(void)
19722068 * Allocate buffer below 4GB for SMI data--only 32-bit physical addr
19732069 * is passed to SMI handler.
19742070 */
1975- bufferpage = alloc_page (GFP_KERNEL | GFP_DMA32 );
1976- if (!bufferpage ) {
2071+ buffer = ( void * ) __get_free_page (GFP_KERNEL | GFP_DMA32 );
2072+ if (!buffer ) {
19772073 ret = - ENOMEM ;
19782074 goto fail_buffer ;
19792075 }
1980- buffer = page_address (bufferpage );
19812076
19822077 ret = dell_setup_rfkill ();
19832078
@@ -2034,7 +2129,7 @@ static int __init dell_init(void)
20342129fail_backlight :
20352130 dell_cleanup_rfkill ();
20362131fail_rfkill :
2037- free_page ((unsigned long )bufferpage );
2132+ free_page ((unsigned long )buffer );
20382133fail_buffer :
20392134 platform_device_del (platform_device );
20402135fail_platform_device2 :
0 commit comments