+osl_pktdup (osl_t * osh, void *skb)
+{
+ void *p;
+
+ if ((p = skb_clone ((struct sk_buff *) skb, GFP_ATOMIC)) == NULL)
+ return NULL;
+
+ /* skb_clone copies skb->cb.. we don't want that */
+ if (osh->pub.pkttag)
+ bzero ((void *) ((struct sk_buff *) p)->cb, OSL_PKTTAG_SZ);
+
+ /* Increment the packet counter */
+ osh->pub.pktalloced++;
+#ifdef BCMDBG_PKT
+ pktlist_add (&(osh->pktlist), (void *) p);
+#endif /* BCMDBG_PKT */
+ return (p);
+}
+
+uint
+osl_pktalloced (osl_t * osh)
+{
+ return (osh->pub.pktalloced);
+}
+
+#ifdef BCMDBG_PKT
+char *
+osl_pktlist_dump (osl_t * osh, char *buf)
+{
+ pktlist_dump (&(osh->pktlist), buf);
+ return buf;
+}
+
+void
+osl_pktlist_add (osl_t * osh, void *p)
+{
+ pktlist_add (&(osh->pktlist), p);
+}
+
+void
+osl_pktlist_remove (osl_t * osh, void *p)
+{
+ pktlist_remove (&(osh->pktlist), p);
+}
+#endif /* BCMDBG_PKT */
+
+/*
+ * BINOSL selects the slightly slower function-call-based binary compatible osl.
+ */
+#ifdef BINOSL
+
+int
+osl_printf (const char *format, ...)
+{
+ va_list args;
+ char buf[1024];
+ int len;
+
+ /* sprintf into a local buffer because there *is* no "vprintk()".. */
+ va_start (args, format);
+ len = vsnprintf (buf, 1024, format, args);
+ va_end (args);
+
+ if (len > sizeof (buf))
+ {
+ printk ("osl_printf: buffer overrun\n");
+ return (0);
+ }
+
+ return (printk (buf));
+}
+
+int
+osl_sprintf (char *buf, const char *format, ...)
+{
+ va_list args;
+ int rc;
+
+ va_start (args, format);
+ rc = vsprintf (buf, format, args);
+ va_end (args);
+ return (rc);
+}
+
+int
+osl_strcmp (const char *s1, const char *s2)
+{
+ return (strcmp (s1, s2));
+}
+
+int
+osl_strncmp (const char *s1, const char *s2, uint n)
+{
+ return (strncmp (s1, s2, n));
+}
+
+int
+osl_strlen (const char *s)
+{
+ return (strlen (s));
+}
+
+char *
+osl_strcpy (char *d, const char *s)
+{
+ return (strcpy (d, s));
+}
+
+char *
+osl_strncpy (char *d, const char *s, uint n)
+{
+ return (strncpy (d, s, n));
+}
+
+void
+bcopy (const void *src, void *dst, int len)
+{
+ memcpy (dst, src, len);
+}
+
+int
+bcmp (const void *b1, const void *b2, int len)
+{
+ return (memcmp (b1, b2, len));
+}
+
+void
+bzero (void *b, int len)
+{
+ memset (b, '\0', len);
+}
+
+uint32
+osl_readl (volatile uint32 * r)
+{
+ return (readl (r));
+}
+
+uint16
+osl_readw (volatile uint16 * r)
+{
+ return (readw (r));
+}
+
+uint8
+osl_readb (volatile uint8 * r)
+{
+ return (readb (r));
+}
+
+void
+osl_writel (uint32 v, volatile uint32 * r)
+{
+ writel (v, r);
+}
+
+void
+osl_writew (uint16 v, volatile uint16 * r)
+{
+ writew (v, r);
+}
+
+void
+osl_writeb (uint8 v, volatile uint8 * r)
+{
+ writeb (v, r);
+}
+
+void *
+osl_uncached (void *va)
+{
+#ifdef mips
+ return ((void *) KSEG1ADDR (va));
+#else
+ return ((void *) va);
+#endif /* mips */
+}
+
+uint
+osl_getcycles (void)