aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* Update docs to reflect new dependencies.Aldo Cortesi2012-03-112-4/+6
* Use PyOpenSSL for certificate generation.Aldo Cortesi2012-03-112-42/+65
* Replace CA generation with PyOpenSSL version.Aldo Cortesi2012-03-112-104/+47
* Merge remote-tracking branch 'meeee/master'Aldo Cortesi2012-03-101-2/+6
|\
| * Fix SSL requests with Transfer-Encoding: chunkedMichael Frister2012-03-081-1/+5
| * Handle Transfer-Encoding header values case insensitiveMichael Frister2012-03-081-1/+1
* | Repair unit tests after nopop introduction.Aldo Cortesi2012-03-101-1/+3
* | Merge remote-tracking branch 'taiste/server-replay-pop'Aldo Cortesi2012-03-104-13/+42
|\ \
| * | Added tests for ServerPlaybackState with nopopValtteri Virtanen2012-03-051-0/+12
| * | Fixed old testsValtteri Virtanen2012-03-051-6/+6
| * | Adds space between sentences on no-pop's helpValtteri Virtanen2012-03-051-1/+1
| * | Adds no-pop option to server-side replayValtteri Virtanen2012-03-053-7/+24
* | | Create an SSL certificate class.Aldo Cortesi2012-03-053-33/+43
|/ /
* | Merge pull request #33 from dnet/masterAldo Cortesi2012-03-012-2/+2
|\ \
| * | Removed imports left unused after Py{OpenSSL,ASN1}András Veres-Szentkirályi2012-03-012-2/+2
|/ /
* | Use PyOpenSSL and PyASN1 for certificate parsing.Aldo Cortesi2012-03-016-196/+227
* | Factor out cert operations in to certutils.py.Aldo Cortesi2012-02-295-303/+310
* | Rationalise upstream cert flag and variable names.Aldo Cortesi2012-02-282-7/+7
* | Merge branch 'upstream-cert'Aldo Cortesi2012-02-289-18/+289
|\ \ | |/ |/|
| * Repair unit tests.Aldo Cortesi2012-02-271-3/+2
| * Fix cert generation harder.Aldo Cortesi2012-02-272-3/+5
| * Fix problems with SANs and certificate generation.Aldo Cortesi2012-02-272-1/+10
| * Better certificate parsing.Aldo Cortesi2012-02-275-4/+115
| * Add upstream certificate lookup.Aldo Cortesi2012-02-277-17/+167
* | Final prep for 0.7.Aldo Cortesi2012-02-273-3/+5
|/
* Introduce a cache for flow list entries.Aldo Cortesi2012-02-273-27/+59
* Fix mitmproxy crash when passed -n flag.Aldo Cortesi2012-02-261-1/+1
* Crush PNGs in docs.Aldo Cortesi2012-02-259-1/+3
* Improve README.txt legibility, add some trove classifiers.Aldo Cortesi2012-02-252-9/+20
* Add README.txt for PyPi.Aldo Cortesi2012-02-254-5/+72
* Merge remote-tracking branch 'remotes/runeh/master' into runehAldo Cortesi2012-02-251-2/+3
|\
| * Use shlex to parse EDITOR.Rune Halvorsen2012-02-251-2/+3
* | Merge branch 'master' of github.com:cortesi/mitmproxyAldo Cortesi2012-02-252-4/+4
|\|
| * Docs update for new commandline and shortcut functionality. Also, typo fix.capt8bit2012-02-242-4/+4
* | Unit test++.Aldo Cortesi2012-02-255-10/+32
|/
* Add mitmproxy version to status bar on Help screen.Aldo Cortesi2012-02-241-2/+3
* Make return arrow match return code color.Aldo Cortesi2012-02-241-3/+5
* Fix detection of URL-encoded forms.Aldo Cortesi2012-02-242-3/+26
* Make "~q" filter work more intuitively.Aldo Cortesi2012-02-232-6/+5
* Refactor filter matching.Aldo Cortesi2012-02-233-95/+71
* Confirm when we clear a request body to add a form.Aldo Cortesi2012-02-232-1/+21
* License notifications, minor docs.Aldo Cortesi2012-02-2313-2/+185
* Add two more examples: dup_and_replay.py and modify_querystring.pyAldo Cortesi2012-02-233-0/+13
* Add an example showing the new form API.Aldo Cortesi2012-02-232-1/+9
* Fall-back for non-unicode terminals.Aldo Cortesi2012-02-231-5/+10
* Documentation and screenshots.Aldo Cortesi2012-02-2217-43/+115
* Always return an ODict from get_queryAldo Cortesi2012-02-211-5/+5
* connection -> flow in libmitmproxy/consoleAldo Cortesi2012-02-214-69/+69
* Minor docs and example script fixes.Aldo Cortesi2012-02-216-7/+14
* Tweaks for reverse proxy modeAldo Cortesi2012-02-213-6/+10
span> = B53_SPI_CMD_NORMAL | B53_SPI_CMD_READ; txbuf[1] = reg; return spi_write_then_read(spi, txbuf, 2, val, len); } static inline int b53_spi_clear_status(struct spi_device *spi) { unsigned int i; u8 rxbuf; int ret; for (i = 0; i < 10; i++) { ret = b53_spi_read_reg(spi, B53_SPI_STATUS, &rxbuf, 1); if (ret) return ret; if (!(rxbuf & B53_SPI_CMD_SPIF)) break; mdelay(1); } if (i == 10) return -EIO; return 0; } static inline int b53_spi_set_page(struct spi_device *spi, u8 page) { u8 txbuf[3]; txbuf[0] = B53_SPI_CMD_NORMAL | B53_SPI_CMD_WRITE; txbuf[1] = B53_SPI_PAGE_SELECT; txbuf[2] = page; return spi_write(spi, txbuf, sizeof(txbuf)); } static inline int b53_prepare_reg_access(struct spi_device *spi, u8 page) { int ret = b53_spi_clear_status(spi); if (ret) return ret; return b53_spi_set_page(spi, page); } static int b53_spi_prepare_reg_read(struct spi_device *spi, u8 reg) { u8 rxbuf; int retry_count; int ret; ret = b53_spi_read_reg(spi, reg, &rxbuf, 1); if (ret) return ret; for (retry_count = 0; retry_count < 10; retry_count++) { ret = b53_spi_read_reg(spi, B53_SPI_STATUS, &rxbuf, 1); if (ret) return ret; if (rxbuf & B53_SPI_CMD_RACK) break; mdelay(1); } if (retry_count == 10) return -EIO; return 0; } static int b53_spi_read(struct b53_device *dev, u8 page, u8 reg, u8 *data, unsigned len) { struct spi_device *spi = dev->priv; int ret; ret = b53_prepare_reg_access(spi, page); if (ret) return ret; ret = b53_spi_prepare_reg_read(spi, reg); if (ret) return ret; return b53_spi_read_reg(spi, B53_SPI_DATA, data, len); } static int b53_spi_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val) { return b53_spi_read(dev, page, reg, val, 1); } static int b53_spi_read16(struct b53_device *dev, u8 page, u8 reg, u16 *val) { int ret = b53_spi_read(dev, page, reg, (u8 *)val, 2); if (!ret) *val = le16_to_cpu(*val); return ret; } static int b53_spi_read32(struct b53_device *dev, u8 page, u8 reg, u32 *val) { int ret = b53_spi_read(dev, page, reg, (u8 *)val, 4); if (!ret) *val = le32_to_cpu(*val); return ret; } static int b53_spi_read48(struct b53_device *dev, u8 page, u8 reg, u64 *val) { int ret; *val = 0; ret = b53_spi_read(dev, page, reg, (u8 *)val, 6); if (!ret) *val = le64_to_cpu(*val); return ret; } static int b53_spi_read64(struct b53_device *dev, u8 page, u8 reg, u64 *val) { int ret = b53_spi_read(dev, page, reg, (u8 *)val, 8); if (!ret) *val = le64_to_cpu(*val); return ret; } static int b53_spi_write8(struct b53_device *dev, u8 page, u8 reg, u8 value) { struct spi_device *spi = dev->priv; int ret; u8 txbuf[3]; ret = b53_prepare_reg_access(spi, page); if (ret) return ret; txbuf[0] = B53_SPI_CMD_NORMAL | B53_SPI_CMD_WRITE; txbuf[1] = reg; txbuf[2] = value; return spi_write(spi, txbuf, sizeof(txbuf)); } static int b53_spi_write16(struct b53_device *dev, u8 page, u8 reg, u16 value) { struct spi_device *spi = dev->priv; int ret; u8 txbuf[4]; ret = b53_prepare_reg_access(spi, page); if (ret) return ret; txbuf[0] = B53_SPI_CMD_NORMAL | B53_SPI_CMD_WRITE; txbuf[1] = reg; put_unaligned_le16(value, &txbuf[2]); return spi_write(spi, txbuf, sizeof(txbuf)); } static int b53_spi_write32(struct b53_device *dev, u8 page, u8 reg, u32 value) { struct spi_device *spi = dev->priv; int ret; u8 txbuf[6]; ret = b53_prepare_reg_access(spi, page); if (ret) return ret; txbuf[0] = B53_SPI_CMD_NORMAL | B53_SPI_CMD_WRITE; txbuf[1] = reg; put_unaligned_le32(value, &txbuf[2]); return spi_write(spi, txbuf, sizeof(txbuf)); } static int b53_spi_write48(struct b53_device *dev, u8 page, u8 reg, u64 value) { struct spi_device *spi = dev->priv; int ret; u8 txbuf[10]; ret = b53_prepare_reg_access(spi, page); if (ret) return ret; txbuf[0] = B53_SPI_CMD_NORMAL | B53_SPI_CMD_WRITE; txbuf[1] = reg; put_unaligned_le64(value, &txbuf[2]); return spi_write(spi, txbuf, sizeof(txbuf) - 2); } static int b53_spi_write64(struct b53_device *dev, u8 page, u8 reg, u64 value) { struct spi_device *spi = dev->priv; int ret; u8 txbuf[10]; ret = b53_prepare_reg_access(spi, page); if (ret) return ret; txbuf[0] = B53_SPI_CMD_NORMAL | B53_SPI_CMD_WRITE; txbuf[1] = reg; put_unaligned_le64(value, &txbuf[2]); return spi_write(spi, txbuf, sizeof(txbuf)); } static struct b53_io_ops b53_spi_ops = { .read8 = b53_spi_read8, .read16 = b53_spi_read16, .read32 = b53_spi_read32, .read48 = b53_spi_read48, .read64 = b53_spi_read64, .write8 = b53_spi_write8, .write16 = b53_spi_write16, .write32 = b53_spi_write32, .write48 = b53_spi_write48, .write64 = b53_spi_write64, }; static int __devinit b53_spi_probe(struct spi_device *spi) { struct b53_device *dev; int ret; dev = b53_switch_alloc(&spi->dev, &b53_spi_ops, spi); if (!dev) return -ENOMEM; if (spi->dev.platform_data) dev->pdata = spi->dev.platform_data; ret = b53_switch_register(dev); if (ret) return ret; spi->dev.platform_data = dev; return 0; } static int __devexit b53_spi_remove(struct spi_device *spi) { struct b53_device *dev = spi->dev.platform_data; if (dev) { struct b53_platform_data *pdata = dev->pdata; b53_switch_remove(dev); spi->dev.platform_data = pdata; } return 0; } static struct spi_driver b53_spi_driver = { .driver = { .name = "b53-switch", .bus = &spi_bus_type, .owner = THIS_MODULE, }, .probe = b53_spi_probe, .remove = __devexit_p(b53_spi_remove), }; module_spi_driver(b53_spi_driver); MODULE_AUTHOR("Jonas Gorski <jogo@openwrt.org>"); MODULE_DESCRIPTION("B53 SPI access driver"); MODULE_LICENSE("Dual BSD/GPL");