From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Cc: marcel@holtmann.org, gustavo@padovan.org
Subject: [PATCH 4/4] Add options to test MaxTx and TxWindow
Date: Tue, 30 Mar 2010 15:53:29 -0300 [thread overview]
Message-ID: <1269975209-10044-4-git-send-email-padovan@profusion.mobi> (raw)
In-Reply-To: <1269975209-10044-3-git-send-email-padovan@profusion.mobi>
---
test/l2test.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/test/l2test.c b/test/l2test.c
index d11992f..9413070 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -75,6 +75,12 @@ static int omtu = 0;
/* Default FCS option */
static int fcs = 0x01;
+/* Default Transmission Window */
+static int txwin_size = 63;
+
+/* Default Max Transmission */
+static int max_transmit = 3;
+
/* Default data size */
static long data_size = -1;
static long buffer_size = 2048;
@@ -226,6 +232,8 @@ static int do_connect(char *svr)
opts.mode = rfcmode;
opts.fcs = fcs;
+ opts.txwin_size = txwin_size;
+ opts.max_tx = max_transmit;
if (setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &opts, sizeof(opts)) < 0) {
syslog(LOG_ERR, "Can't set L2CAP options: %s (%d)",
@@ -388,6 +396,8 @@ static void do_listen(void (*handler)(int sk))
opts.mode = rfcmode;
opts.fcs = fcs;
+ opts.txwin_size = txwin_size;
+ opts.max_tx = max_transmit;
if (setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &opts, sizeof(opts)) < 0) {
syslog(LOG_ERR, "Can't set L2CAP options: %s (%d)",
@@ -1064,6 +1074,8 @@ static void usage(void)
"\t[-D milliseconds] delay after sending num frames (default = 0)\n"
"\t[-X mode] select retransmission/flow-control mode\n"
"\t[-F fcs] use CRC16 check (default = 1)\n"
+ "\t[-Q num] Max Transmit value (default = 3)\n"
+ "\t[-Z size] Transmission Window size (default = 63)\n"
"\t[-R] reliable mode\n"
"\t[-G] use connectionless channel (datagram)\n"
"\t[-U] use sock stream\n"
@@ -1081,7 +1093,7 @@ int main(int argc, char *argv[])
bacpy(&bdaddr, BDADDR_ANY);
- while ((opt=getopt(argc,argv,"rdscuwmntqxyzpb:i:P:I:O:B:N:L:W:C:D:X:F:RUGAESMT")) != EOF) {
+ while ((opt=getopt(argc,argv,"rdscuwmntqxyzpb:i:P:I:O:B:N:L:W:C:D:X:F:Q:Z:RUGAESMT")) != EOF) {
switch(opt) {
case 'r':
mode = RECV;
@@ -1237,6 +1249,14 @@ int main(int argc, char *argv[])
timestamp = 1;
break;
+ case 'Q':
+ max_transmit = atoi(optarg);
+ break;
+
+ case 'Z':
+ txwin_size = atoi(optarg);
+ break;
+
default:
usage();
exit(1);
--
1.6.4.4
next prev parent reply other threads:[~2010-03-30 18:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-30 18:53 [PATCH 1/4] l2test: add option to use SOCK_STREAM Gustavo F. Padovan
2010-03-30 18:53 ` [PATCH 2/4] Add duplex test case to l2test Gustavo F. Padovan
2010-03-30 18:53 ` [PATCH 3/4] Add txWindow and MaxTt to l2cap_options Gustavo F. Padovan
2010-03-30 18:53 ` Gustavo F. Padovan [this message]
2010-04-28 15:55 ` [PATCH 1/4] l2test: add option to use SOCK_STREAM Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1269975209-10044-4-git-send-email-padovan@profusion.mobi \
--to=padovan@profusion.mobi \
--cc=gustavo@padovan.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).