@@ -91,10 +91,6 @@ static struct regulatory_request __rcu *last_request =
91
91
/* To trigger userspace events */
92
92
static struct platform_device * reg_pdev ;
93
93
94
- static const struct device_type reg_device_type = {
95
- .uevent = reg_device_uevent ,
96
- };
97
-
98
94
/*
99
95
* Central wireless core regulatory domains, we only need two,
100
96
* the current one and a world regulatory domain in case we have no
@@ -487,11 +483,16 @@ static inline void reg_regdb_query(const char *alpha2) {}
487
483
488
484
/*
489
485
* This lets us keep regulatory code which is updated on a regulatory
490
- * basis in userspace. Country information is filled in by
491
- * reg_device_uevent
486
+ * basis in userspace.
492
487
*/
493
488
static int call_crda (const char * alpha2 )
494
489
{
490
+ char country [12 ];
491
+ char * env [] = { country , NULL };
492
+
493
+ snprintf (country , sizeof (country ), "COUNTRY=%c%c" ,
494
+ alpha2 [0 ], alpha2 [1 ]);
495
+
495
496
if (!is_world_regdom ((char * ) alpha2 ))
496
497
pr_info ("Calling CRDA for country: %c%c\n" ,
497
498
alpha2 [0 ], alpha2 [1 ]);
@@ -501,7 +502,7 @@ static int call_crda(const char *alpha2)
501
502
/* query internal regulatory database (if it exists) */
502
503
reg_regdb_query (alpha2 );
503
504
504
- return kobject_uevent (& reg_pdev -> dev .kobj , KOBJ_CHANGE );
505
+ return kobject_uevent_env (& reg_pdev -> dev .kobj , KOBJ_CHANGE , env );
505
506
}
506
507
507
508
static enum reg_request_treatment
@@ -2544,26 +2545,6 @@ int set_regdom(const struct ieee80211_regdomain *rd)
2544
2545
return 0 ;
2545
2546
}
2546
2547
2547
- int reg_device_uevent (struct device * dev , struct kobj_uevent_env * env )
2548
- {
2549
- struct regulatory_request * lr ;
2550
- u8 alpha2 [2 ];
2551
- bool add = false;
2552
-
2553
- rcu_read_lock ();
2554
- lr = get_last_request ();
2555
- if (lr && !lr -> processed ) {
2556
- memcpy (alpha2 , lr -> alpha2 , 2 );
2557
- add = true;
2558
- }
2559
- rcu_read_unlock ();
2560
-
2561
- if (add )
2562
- return add_uevent_var (env , "COUNTRY=%c%c" ,
2563
- alpha2 [0 ], alpha2 [1 ]);
2564
- return 0 ;
2565
- }
2566
-
2567
2548
void wiphy_regulatory_register (struct wiphy * wiphy )
2568
2549
{
2569
2550
struct regulatory_request * lr ;
@@ -2614,8 +2595,6 @@ int __init regulatory_init(void)
2614
2595
if (IS_ERR (reg_pdev ))
2615
2596
return PTR_ERR (reg_pdev );
2616
2597
2617
- reg_pdev -> dev .type = & reg_device_type ;
2618
-
2619
2598
spin_lock_init (& reg_requests_lock );
2620
2599
spin_lock_init (& reg_pending_beacons_lock );
2621
2600
0 commit comments