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