@@ -244,16 +244,15 @@ static int kiss_esc_crc(unsigned char *s, unsigned char *d, unsigned short crc,
244
244
/* Send one completely decapsulated AX.25 packet to the AX.25 layer. */
245
245
static void ax_bump (struct mkiss * ax )
246
246
{
247
- unsigned long flags ;
248
247
struct sk_buff * skb ;
249
248
int count ;
250
249
251
- spin_lock_irqsave (& ax -> buflock , flags );
250
+ spin_lock_bh (& ax -> buflock );
252
251
if (ax -> rbuff [0 ] > 0x0f ) {
253
252
if (ax -> rbuff [0 ] & 0x80 ) {
254
253
if (check_crc_16 (ax -> rbuff , ax -> rcount ) < 0 ) {
255
254
ax -> dev -> stats .rx_errors ++ ;
256
- spin_unlock_irqrestore (& ax -> buflock , flags );
255
+ spin_unlock_bh (& ax -> buflock );
257
256
258
257
return ;
259
258
}
@@ -268,7 +267,7 @@ static void ax_bump(struct mkiss *ax)
268
267
} else if (ax -> rbuff [0 ] & 0x20 ) {
269
268
if (check_crc_flex (ax -> rbuff , ax -> rcount ) < 0 ) {
270
269
ax -> dev -> stats .rx_errors ++ ;
271
- spin_unlock_irqrestore (& ax -> buflock , flags );
270
+ spin_unlock_bh (& ax -> buflock );
272
271
return ;
273
272
}
274
273
if (ax -> crcmode != CRC_MODE_FLEX && ax -> crcauto ) {
@@ -295,7 +294,7 @@ static void ax_bump(struct mkiss *ax)
295
294
printk (KERN_ERR "mkiss: %s: memory squeeze, dropping packet.\n" ,
296
295
ax -> dev -> name );
297
296
ax -> dev -> stats .rx_dropped ++ ;
298
- spin_unlock_irqrestore (& ax -> buflock , flags );
297
+ spin_unlock_bh (& ax -> buflock );
299
298
return ;
300
299
}
301
300
@@ -304,13 +303,11 @@ static void ax_bump(struct mkiss *ax)
304
303
netif_rx (skb );
305
304
ax -> dev -> stats .rx_packets ++ ;
306
305
ax -> dev -> stats .rx_bytes += count ;
307
- spin_unlock_irqrestore (& ax -> buflock , flags );
306
+ spin_unlock_bh (& ax -> buflock );
308
307
}
309
308
310
309
static void kiss_unesc (struct mkiss * ax , unsigned char s )
311
310
{
312
- unsigned long flags ;
313
-
314
311
switch (s ) {
315
312
case END :
316
313
/* drop keeptest bit = VSV */
@@ -337,18 +334,18 @@ static void kiss_unesc(struct mkiss *ax, unsigned char s)
337
334
break ;
338
335
}
339
336
340
- spin_lock_irqsave (& ax -> buflock , flags );
337
+ spin_lock_bh (& ax -> buflock );
341
338
if (!test_bit (AXF_ERROR , & ax -> flags )) {
342
339
if (ax -> rcount < ax -> buffsize ) {
343
340
ax -> rbuff [ax -> rcount ++ ] = s ;
344
- spin_unlock_irqrestore (& ax -> buflock , flags );
341
+ spin_unlock_bh (& ax -> buflock );
345
342
return ;
346
343
}
347
344
348
345
ax -> dev -> stats .rx_over_errors ++ ;
349
346
set_bit (AXF_ERROR , & ax -> flags );
350
347
}
351
- spin_unlock_irqrestore (& ax -> buflock , flags );
348
+ spin_unlock_bh (& ax -> buflock );
352
349
}
353
350
354
351
static int ax_set_mac_address (struct net_device * dev , void * addr )
@@ -370,7 +367,6 @@ static void ax_changedmtu(struct mkiss *ax)
370
367
{
371
368
struct net_device * dev = ax -> dev ;
372
369
unsigned char * xbuff , * rbuff , * oxbuff , * orbuff ;
373
- unsigned long flags ;
374
370
int len ;
375
371
376
372
len = dev -> mtu * 2 ;
@@ -396,7 +392,7 @@ static void ax_changedmtu(struct mkiss *ax)
396
392
return ;
397
393
}
398
394
399
- spin_lock_irqsave (& ax -> buflock , flags );
395
+ spin_lock_bh (& ax -> buflock );
400
396
401
397
oxbuff = ax -> xbuff ;
402
398
ax -> xbuff = xbuff ;
@@ -427,7 +423,7 @@ static void ax_changedmtu(struct mkiss *ax)
427
423
ax -> mtu = dev -> mtu + 73 ;
428
424
ax -> buffsize = len ;
429
425
430
- spin_unlock_irqrestore (& ax -> buflock , flags );
426
+ spin_unlock_bh (& ax -> buflock );
431
427
432
428
kfree (oxbuff );
433
429
kfree (orbuff );
@@ -437,7 +433,6 @@ static void ax_changedmtu(struct mkiss *ax)
437
433
static void ax_encaps (struct net_device * dev , unsigned char * icp , int len )
438
434
{
439
435
struct mkiss * ax = netdev_priv (dev );
440
- unsigned long flags ;
441
436
unsigned char * p ;
442
437
int actual , count ;
443
438
@@ -454,7 +449,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
454
449
455
450
p = icp ;
456
451
457
- spin_lock_irqsave (& ax -> buflock , flags );
452
+ spin_lock_bh (& ax -> buflock );
458
453
if ((* p & 0x0f ) != 0 ) {
459
454
/* Configuration Command (kissparms(1).
460
455
* Protocol spec says: never append CRC.
@@ -484,7 +479,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
484
479
ax -> crcauto = (cmd ? 0 : 1 );
485
480
printk (KERN_INFO "mkiss: %s: crc mode %s %d\n" , ax -> dev -> name , (len ) ? "set to" : "is" , cmd );
486
481
}
487
- spin_unlock_irqrestore (& ax -> buflock , flags );
482
+ spin_unlock_bh (& ax -> buflock );
488
483
netif_start_queue (dev );
489
484
490
485
return ;
@@ -517,7 +512,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
517
512
count = kiss_esc (p , (unsigned char * )ax -> xbuff , len );
518
513
}
519
514
}
520
- spin_unlock_irqrestore (& ax -> buflock , flags );
515
+ spin_unlock_bh (& ax -> buflock );
521
516
522
517
set_bit (TTY_DO_WRITE_WAKEUP , & ax -> tty -> flags );
523
518
actual = ax -> tty -> ops -> write (ax -> tty , ax -> xbuff , count );
@@ -709,14 +704,13 @@ static DEFINE_RWLOCK(disc_data_lock);
709
704
710
705
static struct mkiss * mkiss_get (struct tty_struct * tty )
711
706
{
712
- unsigned long flags ;
713
707
struct mkiss * ax ;
714
708
715
- read_lock_irqsave (& disc_data_lock , flags );
709
+ read_lock (& disc_data_lock );
716
710
ax = tty -> disc_data ;
717
711
if (ax )
718
712
atomic_inc (& ax -> refcnt );
719
- read_unlock_irqrestore (& disc_data_lock , flags );
713
+ read_unlock (& disc_data_lock );
720
714
721
715
return ax ;
722
716
}
@@ -815,13 +809,12 @@ static int mkiss_open(struct tty_struct *tty)
815
809
816
810
static void mkiss_close (struct tty_struct * tty )
817
811
{
818
- unsigned long flags ;
819
812
struct mkiss * ax ;
820
813
821
- write_lock_irqsave (& disc_data_lock , flags );
814
+ write_lock (& disc_data_lock );
822
815
ax = tty -> disc_data ;
823
816
tty -> disc_data = NULL ;
824
- write_unlock_irqrestore (& disc_data_lock , flags );
817
+ write_unlock (& disc_data_lock );
825
818
826
819
if (!ax )
827
820
return ;
0 commit comments