1 --- linux/net/irda/irsysctl.c.orig 2003-05-13 11:20:16.000000000 +0200
2 +++ linux/net/irda/irsysctl.c 2005-01-22 18:39:40.496001712 +0100
5 enum { DISCOVERY=1, DEVNAME, DEBUG, FAST_POLL, DISCOVERY_SLOTS,
6 DISCOVERY_TIMEOUT, SLOT_TIMEOUT, MAX_BAUD_RATE, MIN_TX_TURN_TIME,
7 - MAX_NOREPLY_TIME, WARN_NOREPLY_TIME, LAP_KEEPALIVE_TIME, SPECIFIC_DEV };
8 + MAX_TX_DATA_SIZE, MAX_NOREPLY_TIME, WARN_NOREPLY_TIME, LAP_KEEPALIVE_TIME,
11 extern int sysctl_discovery;
12 extern int sysctl_discovery_slots;
14 extern char sysctl_devname[];
15 extern int sysctl_max_baud_rate;
16 extern int sysctl_min_tx_turn_time;
17 +extern int sysctl_max_tx_data_size;
18 extern int sysctl_max_noreply_time;
19 extern int sysctl_warn_noreply_time;
20 extern int sysctl_lap_keepalive_time;
22 static int min_max_baud_rate = 2400;
23 static int max_min_tx_turn_time = 10000; /* See qos.c - IrLAP spec */
24 static int min_min_tx_turn_time = 0;
25 +static int max_max_tx_data_size = 2048; /* See qos.c - IrLAP spec */
26 +static int min_max_tx_data_size = 64;
27 static int max_max_noreply_time = 40; /* See qos.c - IrLAP spec */
28 static int min_max_noreply_time = 3;
29 static int max_warn_noreply_time = 3; /* 3s == standard */
31 { MIN_TX_TURN_TIME, "min_tx_turn_time", &sysctl_min_tx_turn_time,
32 sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec,
33 NULL, &min_min_tx_turn_time, &max_min_tx_turn_time },
34 + { MAX_TX_DATA_SIZE, "max_tx_data_size", &sysctl_max_tx_data_size,
35 + sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec,
36 + NULL, &min_max_tx_data_size, &max_max_tx_data_size },
37 { MAX_NOREPLY_TIME, "max_noreply_time", &sysctl_max_noreply_time,
38 sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec,
39 NULL, &min_max_noreply_time, &max_max_noreply_time },
40 --- linux/net/irda/qos.c.orig 2003-05-13 11:20:16.000000000 +0200
41 +++ linux/net/irda/qos.c 2005-01-22 18:36:46.759413688 +0100
43 * Nonzero values (usec) are used as lower limit to the per-connection
44 * mtt value which was announced by the other end during negotiation.
45 * Might be helpful if the peer device provides too short mtt.
46 - * Default is 10 which means using the unmodified value given by the peer
47 - * except if it's 0 (0 is likely a bug in the other stack).
48 + * Default is 10us which means using the unmodified value given by the
49 + * peer except if it's 0 (0 is likely a bug in the other stack).
51 unsigned sysctl_min_tx_turn_time = 10;
53 + * Maximum data size to be used in transmission in payload of LAP frame.
54 + * There is a bit of confusion in the IrDA spec :
55 + * The LAP spec defines the payload of a LAP frame (I field) to be
56 + * 2048 bytes max (IrLAP 1.1, chapt 6.6.5, p40).
57 + * On the other hand, the PHY mention frames of 2048 bytes max (IrPHY
58 + * 1.2, chapt 5.3.2.1, p41). But, this number includes the LAP header
59 + * (2 bytes), and CRC (32 bits at 4 Mb/s). So, for the I field (LAP
60 + * payload), that's only 2042 bytes. Oups !
61 + * I've had trouble trouble transmitting 2048 bytes frames with USB
62 + * dongles and nsc-ircc at 4 Mb/s, so adjust to 2042... I don't know
63 + * if this bug applies only for 2048 bytes frames or all negociated
64 + * frame sizes, but all hardware seem to support "2048 bytes" frames.
65 + * You can use the sysctl to play with this value anyway.
67 +unsigned sysctl_max_tx_data_size = 2042;
70 * Specific device list limits some negotiation parameters at the connection
72 while ((qos->data_size.value > line_capacity) && (index > 0)) {
73 qos->data_size.value = data_sizes[index--];
74 IRDA_DEBUG(2, __FUNCTION__
75 - "(), redusing data size to %d\n",
76 + "(), reducing data size to %d\n",
77 qos->data_size.value);
79 -#else /* Use method descibed in section 6.6.11 of IrLAP */
80 +#else /* Use method described in section 6.6.11 of IrLAP */
81 while (irlap_requested_line_capacity(qos) > line_capacity) {
82 ASSERT(index != 0, return;);
85 if (qos->window_size.value > 1) {
86 qos->window_size.value--;
87 IRDA_DEBUG(2, __FUNCTION__
88 - "(), redusing window size to %d\n",
89 + "(), reducing window size to %d\n",
90 qos->window_size.value);
91 } else if (index > 1) {
92 qos->data_size.value = data_sizes[index--];
93 IRDA_DEBUG(2, __FUNCTION__
94 - "(), redusing data size to %d\n",
95 + "(), reducing data size to %d\n",
96 qos->data_size.value);
98 WARNING(__FUNCTION__ "(), nothing more we can do!\n");
101 #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
103 + * Fix tx data size according to user limits - Jean II
105 + if (qos->data_size.value > sysctl_max_tx_data_size)
106 + /* Allow non discrete adjustement to avoid loosing capacity */
107 + qos->data_size.value = sysctl_max_tx_data_size;