Re: [PATCH 4/4] Added ethernet support for Raspberry Pi. USB DMA related functions commented out, since DMA support for raspberry is underdevelopment.

2016-08-19 Thread Deval Shah
On Fri, Aug 19, 2016 at 2:51 PM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> I updated the rules to modify FreeBSD code. Please follow them. In
> particular we have:
>
> "Add nothing (even blank lines) before or after the |__rtems__| guards.
> Always include a |__rtems__| in the guards"
>

Actually in some places while adding the |__rtems__| guards, some blank
lines were getting deleted. So the first rule was beig violated. "Only add
lines.  If your patch contains lines starting with a '-', then this is
wrong."

I will correct the other mistakes. i.e. adding the guards at the begining
of the line and including /* __rtems__ */ in the guards.


> Please don't merge changes for a particular BSP and generic changes into
> one commit.


I will correct that.

Any other thing which I should keep in mind before submitting the final
patches ?

Also, do I have to send all the patches again ? or just the ones which I
will add now.

>
>
> On 19/08/16 10:46, Deval Shah wrote:
>
>> ---
>>   freebsd/sys/dev/usb/net/if_smsc.c  | 44
>> ++
>>   freebsd/sys/dev/usb/net/if_smscreg.h   |  1 +
>>   freebsd/sys/dev/usb/net/usb_ethernet.c | 17 +
>>   freebsd/sys/sys/sysctl.h   |  1 +
>>   rtemsbsd/include/bsp/nexus-devices.h   |  2 +
>>   rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 18 +
>>   .../include/rtems/bsd/test/network-config.h.in |  2 +
>>   7 files changed, 85 insertions(+)
>>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>


-- 
Deval Shah
Graduate Student,
B.E. (Hons.) Electrical and Electronics Engineering
BITS Pilani Hyderabad Campus 

Github Profile 
ᐧ
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 4/4] Added ethernet support for Raspberry Pi. USB DMA related functions commented out, since DMA support for raspberry is underdevelopment.

2016-08-19 Thread Sebastian Huber
I updated the rules to modify FreeBSD code. Please follow them. In 
particular we have:


"Add nothing (even blank lines) before or after the |__rtems__| guards. 
Always include a |__rtems__| in the guards"


Please don't merge changes for a particular BSP and generic changes into 
one commit.


On 19/08/16 10:46, Deval Shah wrote:

---
  freebsd/sys/dev/usb/net/if_smsc.c  | 44 ++
  freebsd/sys/dev/usb/net/if_smscreg.h   |  1 +
  freebsd/sys/dev/usb/net/usb_ethernet.c | 17 +
  freebsd/sys/sys/sysctl.h   |  1 +
  rtemsbsd/include/bsp/nexus-devices.h   |  2 +
  rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 18 +
  .../include/rtems/bsd/test/network-config.h.in |  2 +
  7 files changed, 85 insertions(+)


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 4/4] Added ethernet support for Raspberry Pi. USB DMA related functions commented out, since DMA support for raspberry is underdevelopment.

2016-08-19 Thread Deval Shah
---
 freebsd/sys/dev/usb/net/if_smsc.c  | 44 ++
 freebsd/sys/dev/usb/net/if_smscreg.h   |  1 +
 freebsd/sys/dev/usb/net/usb_ethernet.c | 17 +
 freebsd/sys/sys/sysctl.h   |  1 +
 rtemsbsd/include/bsp/nexus-devices.h   |  2 +
 rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 18 +
 .../include/rtems/bsd/test/network-config.h.in |  2 +
 7 files changed, 85 insertions(+)

diff --git a/freebsd/sys/dev/usb/net/if_smsc.c 
b/freebsd/sys/dev/usb/net/if_smsc.c
index 3bdd35a..bdae5eb 100644
--- a/freebsd/sys/dev/usb/net/if_smsc.c
+++ b/freebsd/sys/dev/usb/net/if_smsc.c
@@ -91,7 +91,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#endif
 
 #ifdef FDT
 #include 
@@ -996,7 +998,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_error_t 
error)
/* The frame header is always aligned on a 4 byte 
boundary */
off = ((off + 0x3) & ~0x3);
 
+   #ifndef __rtems__
usbd_copy_out(pc, off, , sizeof(rxhdr));
+   #endif
off += (sizeof(rxhdr) + ETHER_ALIGN);
rxhdr = le32toh(rxhdr);

@@ -1008,9 +1012,21 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)

if (rxhdr & SMSC_RX_STAT_ERROR) {
smsc_dbg_printf(sc, "rx error (hdr 0x%08x)\n", 
rxhdr);
+
+   #ifndef __rtems__
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
+   #else /* __rtems__ */
+   ifp->if_ierrors++;
+   #endif /* __rtems__ */
+
if (rxhdr & SMSC_RX_STAT_COLLISION)
+
+   #ifndef __rtems__
if_inc_counter(ifp, 
IFCOUNTER_COLLISIONS, 1);
+   #else /* __rtems__ */
+   sc->ifp->if_collisions += 1;
+   #endif /* __rtems__ */
+
} else {
 
/* Check if the ethernet frame is too big or 
too small */
@@ -1021,12 +1037,20 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)
m = uether_newbuf();
if (m == NULL) {
smsc_warn_printf(sc, "failed to create 
new mbuf\n");
+
+   #ifndef __rtems__
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 
1);
+   #else /* __rtems__ */
+   ifp->if_iqdrops++;
+   #endif /* __rtems__ */
+
goto tr_setup;
}
+   #ifndef __rtems__

usbd_copy_out(pc, off, mtod(m, uint8_t *), 
pktlen);
 
+   #endif
/* Check if RX TCP/UDP checksumming is being 
offloaded */
if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) {
 
@@ -1061,9 +1085,11 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)
/* Copy the TCP/UDP 
checksum from the last 2 bytes
 * of the transfer and 
put in the csum_data field.
 */
+   #ifndef __rtems__
usbd_copy_out(pc, (off 
+ pktlen),
  
>m_pkthdr.csum_data, 2);
 
+   #endif
/* The data is copied 
in network order, but the
 * csum algorithm in 
the kernel expects it to be
 * in host network 
order.
@@ -1165,19 +1191,31 @@ tr_setup:
txhdr = SMSC_TX_CTRL_0_BUF_SIZE(m->m_pkthdr.len) | 
SMSC_TX_CTRL_0_FIRST_SEG | 
SMSC_TX_CTRL_0_LAST_SEG;
txhdr = htole32(txhdr);
+   #ifndef __rtems__
usbd_copy_in(pc, 0, , sizeof(txhdr));

+   #endif
+
txhdr = SMSC_TX_CTRL_1_PKT_LENGTH(m->m_pkthdr.len);
txhdr =