aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/qos.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/qos.c')
-rw-r--r--net/irda/qos.c71
1 files changed, 34 insertions, 37 deletions
diff --git a/net/irda/qos.c b/net/irda/qos.c
index f3b588c17d3b..5ed6c9a7baee 100644
--- a/net/irda/qos.c
+++ b/net/irda/qos.c
@@ -342,8 +342,6 @@ static void irlap_adjust_qos_settings(struct qos_info *qos)
342 __u32 line_capacity; 342 __u32 line_capacity;
343 int index; 343 int index;
344 344
345 IRDA_DEBUG(2, "%s()\n", __func__);
346
347 /* 345 /*
348 * Make sure the mintt is sensible. 346 * Make sure the mintt is sensible.
349 * Main culprit : Ericsson T39. - Jean II 347 * Main culprit : Ericsson T39. - Jean II
@@ -368,9 +366,8 @@ static void irlap_adjust_qos_settings(struct qos_info *qos)
368 if ((qos->baud_rate.value < 115200) && 366 if ((qos->baud_rate.value < 115200) &&
369 (qos->max_turn_time.value < 500)) 367 (qos->max_turn_time.value < 500))
370 { 368 {
371 IRDA_DEBUG(0, 369 pr_debug("%s(), adjusting max turn time from %d to 500 ms\n",
372 "%s(), adjusting max turn time from %d to 500 ms\n", 370 __func__, qos->max_turn_time.value);
373 __func__, qos->max_turn_time.value);
374 qos->max_turn_time.value = 500; 371 qos->max_turn_time.value = 500;
375 } 372 }
376 373
@@ -385,8 +382,8 @@ static void irlap_adjust_qos_settings(struct qos_info *qos)
385#ifdef CONFIG_IRDA_DYNAMIC_WINDOW 382#ifdef CONFIG_IRDA_DYNAMIC_WINDOW
386 while ((qos->data_size.value > line_capacity) && (index > 0)) { 383 while ((qos->data_size.value > line_capacity) && (index > 0)) {
387 qos->data_size.value = data_sizes[index--]; 384 qos->data_size.value = data_sizes[index--];
388 IRDA_DEBUG(2, "%s(), reducing data size to %d\n", 385 pr_debug("%s(), reducing data size to %d\n",
389 __func__, qos->data_size.value); 386 __func__, qos->data_size.value);
390 } 387 }
391#else /* Use method described in section 6.6.11 of IrLAP */ 388#else /* Use method described in section 6.6.11 of IrLAP */
392 while (irlap_requested_line_capacity(qos) > line_capacity) { 389 while (irlap_requested_line_capacity(qos) > line_capacity) {
@@ -395,12 +392,12 @@ static void irlap_adjust_qos_settings(struct qos_info *qos)
395 /* Must be able to send at least one frame */ 392 /* Must be able to send at least one frame */
396 if (qos->window_size.value > 1) { 393 if (qos->window_size.value > 1) {
397 qos->window_size.value--; 394 qos->window_size.value--;
398 IRDA_DEBUG(2, "%s(), reducing window size to %d\n", 395 pr_debug("%s(), reducing window size to %d\n",
399 __func__, qos->window_size.value); 396 __func__, qos->window_size.value);
400 } else if (index > 1) { 397 } else if (index > 1) {
401 qos->data_size.value = data_sizes[index--]; 398 qos->data_size.value = data_sizes[index--];
402 IRDA_DEBUG(2, "%s(), reducing data size to %d\n", 399 pr_debug("%s(), reducing data size to %d\n",
403 __func__, qos->data_size.value); 400 __func__, qos->data_size.value);
404 } else { 401 } else {
405 net_warn_ratelimited("%s(), nothing more we can do!\n", 402 net_warn_ratelimited("%s(), nothing more we can do!\n",
406 __func__); 403 __func__);
@@ -440,20 +437,20 @@ int irlap_qos_negotiate(struct irlap_cb *self, struct sk_buff *skb)
440 437
441 irlap_adjust_qos_settings(&self->qos_tx); 438 irlap_adjust_qos_settings(&self->qos_tx);
442 439
443 IRDA_DEBUG(2, "Setting BAUD_RATE to %d bps.\n", 440 pr_debug("Setting BAUD_RATE to %d bps.\n",
444 self->qos_tx.baud_rate.value); 441 self->qos_tx.baud_rate.value);
445 IRDA_DEBUG(2, "Setting DATA_SIZE to %d bytes\n", 442 pr_debug("Setting DATA_SIZE to %d bytes\n",
446 self->qos_tx.data_size.value); 443 self->qos_tx.data_size.value);
447 IRDA_DEBUG(2, "Setting WINDOW_SIZE to %d\n", 444 pr_debug("Setting WINDOW_SIZE to %d\n",
448 self->qos_tx.window_size.value); 445 self->qos_tx.window_size.value);
449 IRDA_DEBUG(2, "Setting XBOFS to %d\n", 446 pr_debug("Setting XBOFS to %d\n",
450 self->qos_tx.additional_bofs.value); 447 self->qos_tx.additional_bofs.value);
451 IRDA_DEBUG(2, "Setting MAX_TURN_TIME to %d ms.\n", 448 pr_debug("Setting MAX_TURN_TIME to %d ms.\n",
452 self->qos_tx.max_turn_time.value); 449 self->qos_tx.max_turn_time.value);
453 IRDA_DEBUG(2, "Setting MIN_TURN_TIME to %d usecs.\n", 450 pr_debug("Setting MIN_TURN_TIME to %d usecs.\n",
454 self->qos_tx.min_turn_time.value); 451 self->qos_tx.min_turn_time.value);
455 IRDA_DEBUG(2, "Setting LINK_DISC to %d secs.\n", 452 pr_debug("Setting LINK_DISC to %d secs.\n",
456 self->qos_tx.link_disc_time.value); 453 self->qos_tx.link_disc_time.value);
457 return ret; 454 return ret;
458} 455}
459 456
@@ -537,17 +534,17 @@ static int irlap_param_baud_rate(void *instance, irda_param_t *param, int get)
537 534
538 if (get) { 535 if (get) {
539 param->pv.i = self->qos_rx.baud_rate.bits; 536 param->pv.i = self->qos_rx.baud_rate.bits;
540 IRDA_DEBUG(2, "%s(), baud rate = 0x%02x\n", 537 pr_debug("%s(), baud rate = 0x%02x\n",
541 __func__, param->pv.i); 538 __func__, param->pv.i);
542 } else { 539 } else {
543 /* 540 /*
544 * Stations must agree on baud rate, so calculate 541 * Stations must agree on baud rate, so calculate
545 * intersection 542 * intersection
546 */ 543 */
547 IRDA_DEBUG(2, "Requested BAUD_RATE: 0x%04x\n", (__u16) param->pv.i); 544 pr_debug("Requested BAUD_RATE: 0x%04x\n", (__u16)param->pv.i);
548 final = (__u16) param->pv.i & self->qos_rx.baud_rate.bits; 545 final = (__u16) param->pv.i & self->qos_rx.baud_rate.bits;
549 546
550 IRDA_DEBUG(2, "Final BAUD_RATE: 0x%04x\n", final); 547 pr_debug("Final BAUD_RATE: 0x%04x\n", final);
551 self->qos_tx.baud_rate.bits = final; 548 self->qos_tx.baud_rate.bits = final;
552 self->qos_rx.baud_rate.bits = final; 549 self->qos_rx.baud_rate.bits = final;
553 } 550 }
@@ -578,10 +575,10 @@ static int irlap_param_link_disconnect(void *instance, irda_param_t *param,
578 * Stations must agree on link disconnect/threshold 575 * Stations must agree on link disconnect/threshold
579 * time. 576 * time.
580 */ 577 */
581 IRDA_DEBUG(2, "LINK_DISC: %02x\n", (__u8) param->pv.i); 578 pr_debug("LINK_DISC: %02x\n", (__u8)param->pv.i);
582 final = (__u8) param->pv.i & self->qos_rx.link_disc_time.bits; 579 final = (__u8) param->pv.i & self->qos_rx.link_disc_time.bits;
583 580
584 IRDA_DEBUG(2, "Final LINK_DISC: %02x\n", final); 581 pr_debug("Final LINK_DISC: %02x\n", final);
585 self->qos_tx.link_disc_time.bits = final; 582 self->qos_tx.link_disc_time.bits = final;
586 self->qos_rx.link_disc_time.bits = final; 583 self->qos_rx.link_disc_time.bits = final;
587 } 584 }
@@ -710,8 +707,8 @@ __u32 irlap_max_line_capacity(__u32 speed, __u32 max_turn_time)
710 __u32 line_capacity; 707 __u32 line_capacity;
711 int i,j; 708 int i,j;
712 709
713 IRDA_DEBUG(2, "%s(), speed=%d, max_turn_time=%d\n", 710 pr_debug("%s(), speed=%d, max_turn_time=%d\n",
714 __func__, speed, max_turn_time); 711 __func__, speed, max_turn_time);
715 712
716 i = value_index(speed, baud_rates, 10); 713 i = value_index(speed, baud_rates, 10);
717 j = value_index(max_turn_time, max_turn_times, 4); 714 j = value_index(max_turn_time, max_turn_times, 4);
@@ -721,8 +718,8 @@ __u32 irlap_max_line_capacity(__u32 speed, __u32 max_turn_time)
721 718
722 line_capacity = max_line_capacities[i][j]; 719 line_capacity = max_line_capacities[i][j];
723 720
724 IRDA_DEBUG(2, "%s(), line capacity=%d bytes\n", 721 pr_debug("%s(), line capacity=%d bytes\n",
725 __func__, line_capacity); 722 __func__, line_capacity);
726 723
727 return line_capacity; 724 return line_capacity;
728} 725}
@@ -737,8 +734,8 @@ static __u32 irlap_requested_line_capacity(struct qos_info *qos)
737 irlap_min_turn_time_in_bytes(qos->baud_rate.value, 734 irlap_min_turn_time_in_bytes(qos->baud_rate.value,
738 qos->min_turn_time.value); 735 qos->min_turn_time.value);
739 736
740 IRDA_DEBUG(2, "%s(), requested line capacity=%d\n", 737 pr_debug("%s(), requested line capacity=%d\n",
741 __func__, line_capacity); 738 __func__, line_capacity);
742 739
743 return line_capacity; 740 return line_capacity;
744} 741}