+ /*
+ * XXX -- not sure this is right place to do this
+ * Allocate memory for use by Lance
+ * Memory allocated for:
+ * initialisation block,
+ * ring descriptors,
+ * transmit and receive buffers.
+ */
+
+ /*
+ * XXX - hopefully have better way to get dma'able memory later,
+ * this code assumes that the physical memory address returned
+ * from malloc will be below 16Mb. The Lance's address registers
+ * are only 16 bits wide!
+ */
+
+#define MAXMEM ((NRBUF+NTBUF)*(BUFSIZE) + (NRBUF+NTBUF)*sizeof(struct mds) \
+ + sizeof(struct init_block) + 8)
+ is->init_block = (struct init_block *)malloc(MAXMEM,M_TEMP,M_NOWAIT);
+ if (!is->init_block) {
+ printf("is%d : Couldn't allocate memory for card\n",unit);
+ }
+ /*
+ * XXX -- should take corrective action if not
+ * quadword alilgned, the 8 byte slew factor in MAXMEM
+ * allows for this.
+ */
+
+ if ((u_long)is->init_block & 0x3)
+ printf("is%d: memory allocated not quadword aligned\n");
+