aoecmd.c (ebf8889bd1fe3615991ff4494635d237280652a2) aoecmd.c (abdbf94d7c6f1fcb2931d5cb7562a6159323b704)
1/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
2/*
3 * aoecmd.c
4 * Filesystem request handling methods
5 */
6
7#include <linux/hdreg.h>
8#include <linux/blkdev.h>

--- 106 unchanged lines hidden (view full) ---

115
116 sector = buf->sector;
117 bcnt = buf->bv_resid;
118 if (bcnt > d->maxbcnt)
119 bcnt = d->maxbcnt;
120
121 /* initialize the headers & frame */
122 skb = f->skb;
1/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
2/*
3 * aoecmd.c
4 * Filesystem request handling methods
5 */
6
7#include <linux/hdreg.h>
8#include <linux/blkdev.h>

--- 106 unchanged lines hidden (view full) ---

115
116 sector = buf->sector;
117 bcnt = buf->bv_resid;
118 if (bcnt > d->maxbcnt)
119 bcnt = d->maxbcnt;
120
121 /* initialize the headers & frame */
122 skb = f->skb;
123 h = aoe_hdr(skb);
123 h = (struct aoe_hdr *) skb_mac_header(skb);
124 ah = (struct aoe_atahdr *) (h+1);
125 skb_put(skb, sizeof *h + sizeof *ah);
126 memset(h, 0, skb->len);
127 f->tag = aoehdr_atainit(d, h);
128 f->waited = 0;
129 f->buf = buf;
130 f->bufaddr = buf->bufaddr;
131 f->bcnt = bcnt;

--- 72 unchanged lines hidden (view full) ---

204 if (skb == NULL) {
205 printk(KERN_INFO "aoe: skb alloc failure\n");
206 goto cont;
207 }
208 skb_put(skb, sizeof *h + sizeof *ch);
209 skb->dev = ifp;
210 if (sl_tail == NULL)
211 sl_tail = skb;
124 ah = (struct aoe_atahdr *) (h+1);
125 skb_put(skb, sizeof *h + sizeof *ah);
126 memset(h, 0, skb->len);
127 f->tag = aoehdr_atainit(d, h);
128 f->waited = 0;
129 f->buf = buf;
130 f->bufaddr = buf->bufaddr;
131 f->bcnt = bcnt;

--- 72 unchanged lines hidden (view full) ---

204 if (skb == NULL) {
205 printk(KERN_INFO "aoe: skb alloc failure\n");
206 goto cont;
207 }
208 skb_put(skb, sizeof *h + sizeof *ch);
209 skb->dev = ifp;
210 if (sl_tail == NULL)
211 sl_tail = skb;
212 h = aoe_hdr(skb);
212 h = (struct aoe_hdr *) skb_mac_header(skb);
213 memset(h, 0, sizeof *h + sizeof *ch);
214
215 memset(h->dst, 0xff, sizeof h->dst);
216 memcpy(h->src, ifp->dev_addr, sizeof h->src);
217 h->type = __constant_cpu_to_be16(ETH_P_AOE);
218 h->verfl = AOE_HVER;
219 h->major = cpu_to_be16(aoemajor);
220 h->minor = aoeminor;

--- 78 unchanged lines hidden (view full) ---

299
300 snprintf(buf, sizeof buf,
301 "%15s e%ld.%ld oldtag=%08x@%08lx newtag=%08x\n",
302 "retransmit",
303 d->aoemajor, d->aoeminor, f->tag, jiffies, n);
304 aoechr_error(buf);
305
306 skb = f->skb;
213 memset(h, 0, sizeof *h + sizeof *ch);
214
215 memset(h->dst, 0xff, sizeof h->dst);
216 memcpy(h->src, ifp->dev_addr, sizeof h->src);
217 h->type = __constant_cpu_to_be16(ETH_P_AOE);
218 h->verfl = AOE_HVER;
219 h->major = cpu_to_be16(aoemajor);
220 h->minor = aoeminor;

--- 78 unchanged lines hidden (view full) ---

299
300 snprintf(buf, sizeof buf,
301 "%15s e%ld.%ld oldtag=%08x@%08lx newtag=%08x\n",
302 "retransmit",
303 d->aoemajor, d->aoeminor, f->tag, jiffies, n);
304 aoechr_error(buf);
305
306 skb = f->skb;
307 h = aoe_hdr(skb);
307 h = (struct aoe_hdr *) skb_mac_header(skb);
308 ah = (struct aoe_atahdr *) (h+1);
309 f->tag = n;
310 h->tag = cpu_to_be32(n);
311 memcpy(h->dst, d->addr, sizeof h->dst);
312 memcpy(h->src, d->ifp->dev_addr, sizeof h->src);
313
314 n = DEFAULTBCNT / 512;
315 if (ah->scnt > n) {

--- 212 unchanged lines hidden (view full) ---

528 struct frame *f;
529 struct buf *buf;
530 struct sk_buff *sl;
531 register long n;
532 ulong flags;
533 char ebuf[128];
534 u16 aoemajor;
535
308 ah = (struct aoe_atahdr *) (h+1);
309 f->tag = n;
310 h->tag = cpu_to_be32(n);
311 memcpy(h->dst, d->addr, sizeof h->dst);
312 memcpy(h->src, d->ifp->dev_addr, sizeof h->src);
313
314 n = DEFAULTBCNT / 512;
315 if (ah->scnt > n) {

--- 212 unchanged lines hidden (view full) ---

528 struct frame *f;
529 struct buf *buf;
530 struct sk_buff *sl;
531 register long n;
532 ulong flags;
533 char ebuf[128];
534 u16 aoemajor;
535
536 hin = aoe_hdr(skb);
536 hin = (struct aoe_hdr *) skb_mac_header(skb);
537 aoemajor = be16_to_cpu(get_unaligned(&hin->major));
538 d = aoedev_by_aoeaddr(aoemajor, hin->minor);
539 if (d == NULL) {
540 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
541 "for unknown device %d.%d\n",
542 aoemajor, hin->minor);
543 aoechr_error(ebuf);
544 return;

--- 15 unchanged lines hidden (view full) ---

560 jiffies);
561 aoechr_error(ebuf);
562 return;
563 }
564
565 calc_rttavg(d, tsince(f->tag));
566
567 ahin = (struct aoe_atahdr *) (hin+1);
537 aoemajor = be16_to_cpu(get_unaligned(&hin->major));
538 d = aoedev_by_aoeaddr(aoemajor, hin->minor);
539 if (d == NULL) {
540 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
541 "for unknown device %d.%d\n",
542 aoemajor, hin->minor);
543 aoechr_error(ebuf);
544 return;

--- 15 unchanged lines hidden (view full) ---

560 jiffies);
561 aoechr_error(ebuf);
562 return;
563 }
564
565 calc_rttavg(d, tsince(f->tag));
566
567 ahin = (struct aoe_atahdr *) (hin+1);
568 hout = aoe_hdr(f->skb);
568 hout = (struct aoe_hdr *) skb_mac_header(f->skb);
569 ahout = (struct aoe_atahdr *) (hout+1);
570 buf = f->buf;
571
572 if (ahout->cmdstat == WIN_IDENTIFY)
573 d->flags &= ~DEVFL_PAUSE;
574 if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */
575 printk(KERN_ERR
576 "aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",

--- 117 unchanged lines hidden (view full) ---

694 f = freeframe(d);
695 if (f == NULL) {
696 printk(KERN_ERR "aoe: can't get a frame. This shouldn't happen.\n");
697 return NULL;
698 }
699
700 /* initialize the headers & frame */
701 skb = f->skb;
569 ahout = (struct aoe_atahdr *) (hout+1);
570 buf = f->buf;
571
572 if (ahout->cmdstat == WIN_IDENTIFY)
573 d->flags &= ~DEVFL_PAUSE;
574 if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */
575 printk(KERN_ERR
576 "aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",

--- 117 unchanged lines hidden (view full) ---

694 f = freeframe(d);
695 if (f == NULL) {
696 printk(KERN_ERR "aoe: can't get a frame. This shouldn't happen.\n");
697 return NULL;
698 }
699
700 /* initialize the headers & frame */
701 skb = f->skb;
702 h = aoe_hdr(skb);
702 h = (struct aoe_hdr *) skb_mac_header(skb);
703 ah = (struct aoe_atahdr *) (h+1);
704 skb_put(skb, sizeof *h + sizeof *ah);
705 memset(h, 0, skb->len);
706 f->tag = aoehdr_atainit(d, h);
707 f->waited = 0;
708
709 /* set up ata header */
710 ah->scnt = 1;

--- 14 unchanged lines hidden (view full) ---

725 struct aoedev *d;
726 struct aoe_hdr *h;
727 struct aoe_cfghdr *ch;
728 ulong flags, sysminor, aoemajor;
729 struct sk_buff *sl;
730 enum { MAXFRAMES = 16 };
731 u16 n;
732
703 ah = (struct aoe_atahdr *) (h+1);
704 skb_put(skb, sizeof *h + sizeof *ah);
705 memset(h, 0, skb->len);
706 f->tag = aoehdr_atainit(d, h);
707 f->waited = 0;
708
709 /* set up ata header */
710 ah->scnt = 1;

--- 14 unchanged lines hidden (view full) ---

725 struct aoedev *d;
726 struct aoe_hdr *h;
727 struct aoe_cfghdr *ch;
728 ulong flags, sysminor, aoemajor;
729 struct sk_buff *sl;
730 enum { MAXFRAMES = 16 };
731 u16 n;
732
733 h = aoe_hdr(skb);
733 h = (struct aoe_hdr *) skb_mac_header(skb);
734 ch = (struct aoe_cfghdr *) (h+1);
735
736 /*
737 * Enough people have their dip switches set backwards to
738 * warrant a loud message for this special case.
739 */
740 aoemajor = be16_to_cpu(get_unaligned(&h->major));
741 if (aoemajor == 0xfff) {

--- 59 unchanged lines hidden ---
734 ch = (struct aoe_cfghdr *) (h+1);
735
736 /*
737 * Enough people have their dip switches set backwards to
738 * warrant a loud message for this special case.
739 */
740 aoemajor = be16_to_cpu(get_unaligned(&h->major));
741 if (aoemajor == 0xfff) {

--- 59 unchanged lines hidden ---