I would like to do this in order to use the wifi dongle on my pi
There are several methods to do so:
- Connecting the arduino via the USB connector on the RaspberryPi and controlling it as you would do from a PC.
- Using a specially designed shield (for RaspberryPi), as Alamode (Alamode web site).
- Build yourself that shield, as in: http://www.instructables.com/id/The-Raspberry-Pi-Arduino-Connection/
But if what you are looking for is to give Arduino wifi connectivity using the RaspberryPi as a "wifi shield" for the arduino, I think that maybe you are being a bit overengineering it.
You could also use a device like this: http://www.instructables.com/id/How-to-use-and-Arduino-shield-with-the-Raspberry-P/
Which is designed by Dexter Industries here: http://www.dexterindustries.com/Arduberry "The Arduberry marries the Raspberry Pi and the Arduino." It's entirely open source.
Basically, this is an Arduino that connects to the Pi, and allows you to either stack Arduino shields on top, or to access the GPIOs. You can program the Arduino directly from the Raspberry Pi over the GPIOs.