[Bluetooth] Add parameters to control BNEP header compression

The Bluetooth qualification for PAN demands testing with BNEP header
compression disabled. This is actually pretty stupid and the Linux
implementation outsmarts the test system since it compresses whenever
possible. So to pass qualification two need parameters have been added
to control the compression of source and destination headers.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

+12 -3
+12 -3
net/bluetooth/bnep/core.c
··· 57 #define BT_DBG(D...) 58 #endif 59 60 - #define VERSION "1.2" 61 62 static LIST_HEAD(bnep_session_list); 63 static DECLARE_RWSEM(bnep_session_sem); ··· 421 iv[il++] = (struct kvec) { &type, 1 }; 422 len++; 423 424 - if (!compare_ether_addr(eh->h_dest, s->eh.h_source)) 425 type |= 0x01; 426 427 - if (!compare_ether_addr(eh->h_source, s->eh.h_dest)) 428 type |= 0x02; 429 430 if (type) ··· 729 730 module_init(bnep_init); 731 module_exit(bnep_exit); 732 733 MODULE_AUTHOR("David Libault <david.libault@inventel.fr>, Maxim Krasnyansky <maxk@qualcomm.com>"); 734 MODULE_DESCRIPTION("Bluetooth BNEP ver " VERSION);
··· 57 #define BT_DBG(D...) 58 #endif 59 60 + #define VERSION "1.3" 61 + 62 + static int compress_src = 1; 63 + static int compress_dst = 1; 64 65 static LIST_HEAD(bnep_session_list); 66 static DECLARE_RWSEM(bnep_session_sem); ··· 418 iv[il++] = (struct kvec) { &type, 1 }; 419 len++; 420 421 + if (compress_src && !compare_ether_addr(eh->h_dest, s->eh.h_source)) 422 type |= 0x01; 423 424 + if (compress_dst && !compare_ether_addr(eh->h_source, s->eh.h_dest)) 425 type |= 0x02; 426 427 if (type) ··· 726 727 module_init(bnep_init); 728 module_exit(bnep_exit); 729 + 730 + module_param(compress_src, bool, 0644); 731 + MODULE_PARM_DESC(compress_src, "Compress sources headers"); 732 + 733 + module_param(compress_dst, bool, 0644); 734 + MODULE_PARM_DESC(compress_dst, "Compress destination headers"); 735 736 MODULE_AUTHOR("David Libault <david.libault@inventel.fr>, Maxim Krasnyansky <maxk@qualcomm.com>"); 737 MODULE_DESCRIPTION("Bluetooth BNEP ver " VERSION);