@@ -298,18 +298,18 @@ static void reg_rule2rd(uint8_t *db, int dblen,
298
298
299
299
/* Converts a file regdomain to ieee80211_regdomain, easier to manage */
300
300
const static struct ieee80211_regdomain *
301
- country2rd (uint8_t * db , int dblen ,
301
+ country2rd (const struct reglib_regdb_ctx * ctx ,
302
302
struct regdb_file_reg_country * country )
303
303
{
304
304
struct regdb_file_reg_rules_collection * rcoll ;
305
305
struct ieee80211_regdomain * rd ;
306
306
int i , num_rules , size_of_rd ;
307
307
308
- rcoll = reglib_get_file_ptr (db , dblen , sizeof (* rcoll ),
309
- country -> reg_collection_ptr );
308
+ rcoll = reglib_get_file_ptr (ctx -> db , ctx -> dblen , sizeof (* rcoll ),
309
+ country -> reg_collection_ptr );
310
310
num_rules = ntohl (rcoll -> reg_rule_num );
311
311
/* re-get pointer with sanity checking for num_rules */
312
- rcoll = reglib_get_file_ptr (db , dblen ,
312
+ rcoll = reglib_get_file_ptr (ctx -> db , ctx -> dblen ,
313
313
sizeof (* rcoll ) + num_rules * sizeof (uint32_t ),
314
314
country -> reg_collection_ptr );
315
315
@@ -328,7 +328,7 @@ country2rd(uint8_t *db, int dblen,
328
328
rd -> n_reg_rules = num_rules ;
329
329
330
330
for (i = 0 ; i < num_rules ; i ++ ) {
331
- reg_rule2rd (db , dblen , rcoll -> reg_rule_ptrs [i ],
331
+ reg_rule2rd (ctx -> db , ctx -> dblen , rcoll -> reg_rule_ptrs [i ],
332
332
& rd -> reg_rules [i ]);
333
333
}
334
334
@@ -351,7 +351,7 @@ reglib_get_rd_idx(unsigned int idx, const char *file)
351
351
352
352
country = ctx -> countries + idx ;
353
353
354
- rd = country2rd (ctx -> db , ctx -> dblen , country );
354
+ rd = country2rd (ctx , country );
355
355
if (!rd )
356
356
goto out ;
357
357
@@ -384,7 +384,7 @@ reglib_get_rd_alpha2(const char *alpha2, const char *file)
384
384
if (!found_country )
385
385
goto out ;
386
386
387
- rd = country2rd (ctx -> db , ctx -> dblen , country );
387
+ rd = country2rd (ctx , country );
388
388
if (!rd )
389
389
goto out ;
390
390
0 commit comments