From: Dan Cross <cross@math.psu.edu>
To: 9fans@cse.psu.edu
Cc: 9trouble@plan9.bell-labs.com
Subject: Re: [9fans] Patch to wavelan driver, specify heys in hex.
Date: Sun, 29 Jun 2003 15:05:00 -0400 [thread overview]
Message-ID: <200306291905.h5TJ50703280@augusta.math.psu.edu> (raw)
In-Reply-To: Your message of "Sun, 29 Jun 2003 15:01:16 EDT." <200306291901.h5TJ1G703256@augusta.math.psu.edu>
Naturally, it would help if I included the patch....
- Dan C.
*** /n/sources/plan9/sys/src/9/port/lib.h Thu Feb 28 16:19:35 2002
--- lib.h Sun Jun 29 14:08:46 2003
***************
*** 99,104 ****
--- 99,105 ----
extern char end[];
extern int getfields(char*, char**, int, int, char*);
extern int tokenize(char*, char**, int);
+ extern int dec16(uchar*, int, char*, int);
extern int dec64(uchar*, int, char*, int);
/*
*** /n/sources/plan9/sys/src/9/pc/wavelan.c Sun Jun 22 12:33:01 2003
--- wavelan.c Sat Jun 28 19:30:57 2003
***************
*** 1036,1046 ****
if((i = atoi(cb->f[0]+3)) >= 1 && i <= WNKeys){
ctlr->txkey = i-1;
key = &ctlr->keys.keys[ctlr->txkey];
- key->len = strlen(cb->f[1]);
- if(key->len > WKeyLen)
- key->len = WKeyLen;
memset(key->dat, 0, sizeof(key->dat));
! memmove(key->dat, cb->f[1], key->len);
}
else
r = -1;
--- 1036,1051 ----
if((i = atoi(cb->f[0]+3)) >= 1 && i <= WNKeys){
ctlr->txkey = i-1;
key = &ctlr->keys.keys[ctlr->txkey];
memset(key->dat, 0, sizeof(key->dat));
! p = cb->f[1];
! if(strncmp(p, "0x", 2) == 0)
! key->len = dec16(key->dat, WKeyLen, p + 2, strlen(p) - 2);
! else {
! key->len = strlen(p);
! if(key->len > WKeyLen)
! key->len = WKeyLen;
! memmove(key->dat, p, key->len);
! }
}
else
r = -1;
prev parent reply other threads:[~2003-06-29 19:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-29 19:01 Dan Cross
2003-06-29 19:05 ` Dan Cross [this message]
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=200306291905.h5TJ50703280@augusta.math.psu.edu \
--to=cross@math.psu.edu \
--cc=9fans@cse.psu.edu \
--cc=9trouble@plan9.bell-labs.com \
/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).